mirror of git://git.suckless.org/sbase
Check return value of sysinfo()
This commit is contained in:
parent
f088b12877
commit
9e8a7ac616
3
free.c
3
free.c
|
@ -24,7 +24,8 @@ main(int argc, char *argv[])
|
|||
{
|
||||
struct sysinfo info;
|
||||
|
||||
sysinfo(&info);
|
||||
if (sysinfo(&info) < 0)
|
||||
eprintf("sysinfo:");
|
||||
mem_unit = info.mem_unit ? info.mem_unit : 1;
|
||||
|
||||
ARGBEGIN {
|
||||
|
|
3
ps.c
3
ps.c
|
@ -122,7 +122,8 @@ psout(struct procstat *ps)
|
|||
if (errno || !pw)
|
||||
eprintf("getpwuid %d:", puid);
|
||||
|
||||
sysinfo(&info);
|
||||
if (sysinfo(&info) < 0)
|
||||
eprintf("sysinfo:");
|
||||
start = time(NULL) - info.uptime;
|
||||
start += (ps->starttime / sysconf(_SC_CLK_TCK));
|
||||
tm = localtime(&start);
|
||||
|
|
Loading…
Reference in New Issue