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;