If we can't change the scheduling priority, warn but still execute

the requested utility. This is how nice(1) traditionall behaved,
and the behaviour required by SUSv3 and POSIX.2 UPE.

Submitted by:	Peter Avalos <pavalos@theshell.com> (partially)
Reviewed by:	mike
This commit is contained in:
Tim J. Robbins 2002-05-13 08:03:20 +00:00
parent efe5270b1e
commit c8d3b41d7c
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=96502

View File

@ -100,9 +100,9 @@ main(argc, argv)
errno = 0;
niceness += getpriority(PRIO_PROCESS, 0);
if (errno)
err(1, "getpriority");
if (setpriority(PRIO_PROCESS, 0, (int)niceness))
err(1, "setpriority");
warn("getpriority");
else if (setpriority(PRIO_PROCESS, 0, (int)niceness))
warn("setpriority");
execvp(*argv, argv);
err(errno == ENOENT ? 127 : 126, "%s", *argv);
}