mirror of
https://git.FreeBSD.org/src.git
synced 2024-11-29 08:08:37 +00:00
Accept decimal user IDs with -u option as well as usernames.
PR: 36950
This commit is contained in:
parent
03ed70f315
commit
ae5a682066
Notes:
svn2git
2020-12-20 02:59:44 +00:00
svn path=/head/; revision=96763
@ -63,7 +63,7 @@ scheduling priority of one or more running processes.
|
||||
The following
|
||||
.Ar who
|
||||
parameters are interpreted as process ID's, process group
|
||||
ID's, or user names.
|
||||
ID's, user ID's or user names.
|
||||
.Nm Renice Ns 'ing
|
||||
a process group causes all processes in the process group
|
||||
to have their scheduling priority altered.
|
||||
@ -87,7 +87,7 @@ the current priority of each process.
|
||||
.It Fl u
|
||||
Force the
|
||||
.Ar who
|
||||
parameters to be interpreted as user names.
|
||||
parameters to be interpreted as user names or user ID's.
|
||||
.It Fl p
|
||||
Resets the
|
||||
.Ar who
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user