]> granicus.if.org Git - procps-ng/commitdiff
pgrep.c: simplifying uptime call
authored <ed@s5h.net>
Thu, 21 Mar 2019 21:32:22 +0000 (21:32 +0000)
committerCraig Small <csmall@dropbear.xyz>
Sun, 17 May 2020 11:53:39 +0000 (21:53 +1000)
pgrep.c

diff --git a/pgrep.c b/pgrep.c
index 1e08992b3feb4ade2312cc8717615766b11231d3..58a8842b7ce02c9173f44225c700fc55c175332b 100644 (file)
--- a/pgrep.c
+++ b/pgrep.c
@@ -530,14 +530,14 @@ static struct el * select_procs (int *num)
        char *cmdoutput = xmalloc(cmdlen);
        proc_t ns_task;
        time_t now;
-       double uptime_secs, idle_secs;
+       int uptime_secs;
 
 
        ptp = do_openproc();
        preg = do_regcomp();
 
        now = time(NULL);
-       if (uptime(&uptime_secs, &idle_secs) == 0)
+       if ((uptime_secs=uptime(0,0)) == 0)
                xerrx(EXIT_FAILURE, "uptime");
 
        if (opt_newest) saved_start_time =  0ULL;