ps: one case for error handling
This commit is contained in:
parent
f48d545c77
commit
fa0b80442c
8
ps.c
8
ps.c
@ -136,12 +136,8 @@ psout(struct procstat *ps)
|
|||||||
} else {
|
} else {
|
||||||
errno = 0;
|
errno = 0;
|
||||||
pw = getpwuid(pstatus.uid);
|
pw = getpwuid(pstatus.uid);
|
||||||
if (!pw) {
|
if (!pw)
|
||||||
if (errno)
|
eprintf("getpwuid %d:", pstatus.uid);
|
||||||
eprintf("getpwuid %d:", pstatus.uid);
|
|
||||||
else
|
|
||||||
eprintf("getpwuid %d: no such user\n", pstatus.uid);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (sysinfo(&info) < 0)
|
if (sysinfo(&info) < 0)
|
||||||
eprintf("sysinfo:");
|
eprintf("sysinfo:");
|
||||||
|
Loading…
Reference in New Issue
Block a user