diff options
author | tjr <tjr@FreeBSD.org> | 2002-05-13 08:03:20 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-05-13 08:03:20 +0000 |
commit | e54018774deec644f793180e785a74a70a93fec3 (patch) | |
tree | 64c438714f26f2afa38e0a81343ed658f07992c0 /usr.bin | |
parent | 135bb8bda20243a1d25ec3f1957340e0ad3adb78 (diff) | |
download | FreeBSD-src-e54018774deec644f793180e785a74a70a93fec3.zip FreeBSD-src-e54018774deec644f793180e785a74a70a93fec3.tar.gz |
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
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/nice/nice.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/nice/nice.c b/usr.bin/nice/nice.c index 13634a1..527e3f0 100644 --- a/usr.bin/nice/nice.c +++ b/usr.bin/nice/nice.c @@ -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); } |