mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-04-30 03:40:34 +02:00
Check return value of nice
'nice' is marked as 'warn_unused_result' on some versions of Ubuntu which causes make distcheck to fail. This implements the error checking logic exactly as POSIX suggests to silence the warning. * libguile/posix.c (scm_nice): new error checking logic.
This commit is contained in:
parent
a0805cc274
commit
58723e026a
1 changed files with 2 additions and 2 deletions
|
@ -2137,8 +2137,8 @@ SCM_DEFINE (scm_nice, "nice", 1, 0, 0,
|
||||||
/* nice() returns "prio-NZERO" on success or -1 on error, but -1 can arise
|
/* nice() returns "prio-NZERO" on success or -1 on error, but -1 can arise
|
||||||
from "prio-NZERO", so an error must be detected from errno changed */
|
from "prio-NZERO", so an error must be detected from errno changed */
|
||||||
errno = 0;
|
errno = 0;
|
||||||
nice (scm_to_int (incr));
|
int prio = nice (scm_to_int (incr));
|
||||||
if (errno != 0)
|
if (prio == -1 && errno != 0)
|
||||||
SCM_SYSERROR;
|
SCM_SYSERROR;
|
||||||
|
|
||||||
return SCM_UNSPECIFIED;
|
return SCM_UNSPECIFIED;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue