ps: one case for error handling

This commit is contained in:
Hiltjo Posthuma 2014-07-12 20:32:36 +00:00 committed by sin
parent f48d545c77
commit fa0b80442c

8
ps.c
View File

@ -136,12 +136,8 @@ psout(struct procstat *ps)
} else {
errno = 0;
pw = getpwuid(pstatus.uid);
if (!pw) {
if (errno)
eprintf("getpwuid %d:", pstatus.uid);
else
eprintf("getpwuid %d: no such user\n", pstatus.uid);
}
if (!pw)
eprintf("getpwuid %d:", pstatus.uid);
if (sysinfo(&info) < 0)
eprintf("sysinfo:");