This is an automated email from the git hooks/post-receive script.
mike121 pushed a commit to branch main
in repository guile.
The following commit(s) were added to refs/heads/main by this push:
new 58723e026 Check return value of nice
58723e026 is described below
commit 58723e026a91ace37d9871dd9fb277a4a1e7434e
Author: Michael Gran <[email protected]>
AuthorDate: Fri Jun 9 13:06:41 2023 -0700
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.
---
libguile/posix.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/libguile/posix.c b/libguile/posix.c
index 4564cb33b..4ca8d5ff7 100644
--- a/libguile/posix.c
+++ b/libguile/posix.c
@@ -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
from "prio-NZERO", so an error must be detected from errno changed */
errno = 0;
- nice (scm_to_int (incr));
- if (errno != 0)
+ int prio = nice (scm_to_int (incr));
+ if (prio == -1 && errno != 0)
SCM_SYSERROR;
return SCM_UNSPECIFIED;