summaryrefslogtreecommitdiff
path: root/usr.bin/nice
diff options
context:
space:
mode:
authorTim J. Robbins <tjr@FreeBSD.org>2002-05-13 08:03:20 +0000
committerTim J. Robbins <tjr@FreeBSD.org>2002-05-13 08:03:20 +0000
commitc8d3b41d7c13a0c391a18ba08dd0e5eaafb98def (patch)
tree64c438714f26f2afa38e0a81343ed658f07992c0 /usr.bin/nice
parentefe5270b1ec6d15a0b954ef5fe2de004637e0c21 (diff)
downloadsrc-test-c8d3b41d7c13a0c391a18ba08dd0e5eaafb98def.tar.gz
src-test-c8d3b41d7c13a0c391a18ba08dd0e5eaafb98def.zip
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
Notes
Notes: svn path=/head/; revision=96502
Diffstat (limited to 'usr.bin/nice')
-rw-r--r--usr.bin/nice/nice.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/nice/nice.c b/usr.bin/nice/nice.c
index 13634a13b804e..527e3f0689b87 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);
}