pgrep.c: simplifying uptime call
This commit is contained in:
parent
79a4eb6128
commit
9975595b9b
4
pgrep.c
4
pgrep.c
@ -530,14 +530,14 @@ static struct el * select_procs (int *num)
|
|||||||
char *cmdoutput = xmalloc(cmdlen);
|
char *cmdoutput = xmalloc(cmdlen);
|
||||||
proc_t ns_task;
|
proc_t ns_task;
|
||||||
time_t now;
|
time_t now;
|
||||||
double uptime_secs, idle_secs;
|
int uptime_secs;
|
||||||
|
|
||||||
|
|
||||||
ptp = do_openproc();
|
ptp = do_openproc();
|
||||||
preg = do_regcomp();
|
preg = do_regcomp();
|
||||||
|
|
||||||
now = time(NULL);
|
now = time(NULL);
|
||||||
if (uptime(&uptime_secs, &idle_secs) == 0)
|
if ((uptime_secs=uptime(0,0)) == 0)
|
||||||
xerrx(EXIT_FAILURE, "uptime");
|
xerrx(EXIT_FAILURE, "uptime");
|
||||||
|
|
||||||
if (opt_newest) saved_start_time = 0ULL;
|
if (opt_newest) saved_start_time = 0ULL;
|
||||||
|
Loading…
Reference in New Issue
Block a user