diff options
author | Elliott Hughes <enh@google.com> | 2019-03-18 20:37:53 -0700 |
---|---|---|
committer | Rob Landley <rob@landley.net> | 2019-03-18 23:37:05 -0500 |
commit | 95574e3f2a47291651f7c78c873318344565e80e (patch) | |
tree | e3ff1282473f9f0724770fec64b2a4b3457364e2 /toys/posix/nice.c | |
parent | 7709875b443fcd155e1737f18d3fff75c4b2753a (diff) | |
download | toybox-95574e3f2a47291651f7c78c873318344565e80e.tar.gz |
cmp/env/nice/nohup/sort: use TOYFLAG_ARGFAIL.
Also be a bit more consistent about `COMMAND [ARG...]` in usage text.
Diffstat (limited to 'toys/posix/nice.c')
-rw-r--r-- | toys/posix/nice.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/toys/posix/nice.c b/toys/posix/nice.c index ca5e2224..c26f66d3 100644 --- a/toys/posix/nice.c +++ b/toys/posix/nice.c @@ -10,7 +10,7 @@ config NICE bool "nice" default y help - usage: nice [-n PRIORITY] command [args...] + usage: nice [-n PRIORITY] COMMAND [ARG...] Run a command line at an increased or decreased scheduling priority. @@ -32,7 +32,9 @@ void nice_main(void) if (!toys.optflags) TT.n = 10; errno = 0; - if (nice(TT.n)==-1 && errno) perror_exit("Can't set priority"); - + if (nice(TT.n)==-1 && errno) { + toys.exitval = 125; + perror_exit("Can't set priority"); + } xexec(toys.optargs); } |