mirror of
https://git.savannah.gnu.org/git/guile.git
synced 2025-05-29 16:30:19 +02:00
(scm_nice): Correction to error detection. Reported by
Matthias Koeppe.
This commit is contained in:
parent
711cd59302
commit
eaaf29a278
1 changed files with 5 additions and 1 deletions
|
@ -1366,7 +1366,11 @@ SCM_DEFINE (scm_nice, "nice", 1, 0, 0,
|
||||||
#define FUNC_NAME s_scm_nice
|
#define FUNC_NAME s_scm_nice
|
||||||
{
|
{
|
||||||
SCM_VALIDATE_INUM (1,incr);
|
SCM_VALIDATE_INUM (1,incr);
|
||||||
if (nice(SCM_INUM(incr)) != 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_INUM(incr));
|
||||||
|
if (errno != 0)
|
||||||
SCM_SYSERROR;
|
SCM_SYSERROR;
|
||||||
return SCM_UNSPECIFIED;
|
return SCM_UNSPECIFIED;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue