diff options
author | tjr <tjr@FreeBSD.org> | 2002-05-25 10:37:24 +0000 |
---|---|---|
committer | tjr <tjr@FreeBSD.org> | 2002-05-25 10:37:24 +0000 |
commit | 8ad547bb95f7cea40437baac3ae2c603fc5b387d (patch) | |
tree | e0249732a144c895fac5e471868f58e9a890531c /usr.bin/renice | |
parent | 0adccddf2f8f210a182c3e4bdd83e7a415b9fc6a (diff) | |
download | FreeBSD-src-8ad547bb95f7cea40437baac3ae2c603fc5b387d.zip FreeBSD-src-8ad547bb95f7cea40437baac3ae2c603fc5b387d.tar.gz |
Bad numeric arguments or usernames should cause non-zero exit status.
Diffstat (limited to 'usr.bin/renice')
-rw-r--r-- | usr.bin/renice/renice.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/usr.bin/renice/renice.c b/usr.bin/renice/renice.c index cda69fd..c3864c9 100644 --- a/usr.bin/renice/renice.c +++ b/usr.bin/renice/renice.c @@ -104,17 +104,22 @@ main(int argc, char *argv[]) if (which == PRIO_USER) { if ((pwd = getpwnam(*argv)) != NULL) who = pwd->pw_uid; - else if (getnum("uid", *argv, &who)) + else if (getnum("uid", *argv, &who)) { + errs++; continue; - else if (who < 0) { + } else if (who < 0) { warnx("%s: bad value", *argv); + errs++; continue; } } else { - if (getnum("pid", *argv, &who)) + if (getnum("pid", *argv, &who)) { + errs++; continue; + } if (who < 0) { warnx("%s: bad value", *argv); + errs++; continue; } } |