summaryrefslogtreecommitdiffstats
path: root/usr.bin/renice/renice.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.bin/renice/renice.c')
-rw-r--r--usr.bin/renice/renice.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/usr.bin/renice/renice.c b/usr.bin/renice/renice.c
index effa8cf..71c7087 100644
--- a/usr.bin/renice/renice.c
+++ b/usr.bin/renice/renice.c
@@ -102,12 +102,14 @@ main(int argc, char *argv[])
continue;
}
if (which == PRIO_USER) {
- pwd = getpwnam(*argv);
- if (pwd == NULL) {
- warnx("%s: unknown user", *argv);
+ if ((pwd = getpwnam(*argv)) != NULL)
+ who = pwd->pw_uid;
+ else if (getnum("uid", *argv, &who))
+ continue;
+ else if (who < 0) {
+ warnx("%s: bad value", *argv);
continue;
}
- who = pwd->pw_uid;
} else {
if (getnum("pid", *argv, &who))
continue;
OpenPOWER on IntegriCloud