Use PRIO_{MIN,MAX} instead of NZERO

Some systems do not define NZERO.  NZERO seems to be an XSI extension
and PRIO_{MIN,MAX} is not specified by POSIX but most relevant systems
define it.
This commit is contained in:
sin
2014-11-17 15:01:43 +00:00
parent bd3cf55b54
commit 166bc3052e
2 changed files with 2 additions and 2 deletions

View File

@@ -105,7 +105,7 @@ renice(int which, int who, long adj)
return 0;
}
adj = MAX(-NZERO, MIN(adj, NZERO - 1));
adj = MAX(PRIO_MIN, MIN(adj, PRIO_MAX));
if (setpriority(which, who, (int)adj) == -1) {
fprintf(stderr, "can't set %d nice level: %s\n",
who, strerror(errno));