mirror of git://git.suckless.org/ubase
Only check errno if getpwuid() fails
Checking errno otherwise is unspecified.
This commit is contained in:
parent
291aedb875
commit
e45e64491e
8
ps.c
8
ps.c
|
@ -136,8 +136,12 @@ psout(struct procstat *ps)
|
|||
} else {
|
||||
errno = 0;
|
||||
pw = getpwuid(pstatus.uid);
|
||||
if (errno || !pw)
|
||||
eprintf("getpwuid %d:", pstatus.uid);
|
||||
if (!pw) {
|
||||
if (errno)
|
||||
eprintf("getpwuid %d:", pstatus.uid);
|
||||
else
|
||||
eprintf("getpwuid %d: no such user\n", id);
|
||||
}
|
||||
|
||||
if (sysinfo(&info) < 0)
|
||||
eprintf("sysinfo:");
|
||||
|
|
Loading…
Reference in New Issue