Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: [PATCH] POSIX compliant nice error checking



On Wed, 2019-10-16 at 19:26 +0300, _RuRo_ (Андрей Стоцкий) wrote:
> In `Src/exec.c`, the return value of nice(5) is checked, however
> according to POSIX (http://man7.org/linux/man-pages/man2/nice.2.html),
> one should check errno instead, since nice can return negative values
> even on success. Since nice(5) increments the niceness by 5, the
> return value can be negative, if the original niceness was less than
> -5. For example, with nice -6, you'll get the annoying `zsh: nice(5)
> failed: success` error message:

Thanks, I've committed that --- I suppose there's a vague possibility of
a problem with older systems that might not have set errno but that
doesn't seem worth worrying about.

pws


Messages sorted by: Reverse Date, Date, Thread, Author