From: Jim Warner Date: Sat, 26 Feb 2022 06:00:00 +0000 (-0600) Subject: pgrep: adapted to the library changes for 'TIME' stuff X-Git-Tag: v4.0.0~36 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9b80d47df54610dc397f6aedb7ab94df0b1c091a;p=procps-ng pgrep: adapted to the library changes for 'TIME' stuff The library refactored 'TIME' items for consistency so we must adapt to some new data types and calculations. Signed-off-by: Jim Warner --- diff --git a/pgrep.c b/pgrep.c index 1a0041c7..328873b1 100644 --- a/pgrep.c +++ b/pgrep.c @@ -67,7 +67,7 @@ enum pids_item Items[] = { PIDS_ID_RGID, PIDS_ID_SESSION, PIDS_ID_TGID, - PIDS_TIME_START, + PIDS_TICS_BEGAN, PIDS_TTY_NAME, PIDS_CMD, PIDS_CMDLINE, @@ -569,6 +569,7 @@ static struct el * select_procs (int *num) #define PIDS_GETSTR(e) PIDS_VAL(EU_ ## e, str, stack, info) #define PIDS_GETSCH(e) PIDS_VAL(EU_ ## e, s_ch, stack, info) #define PIDS_GETSTV(e) PIDS_VAL(EU_ ## e, strv, stack, info) +#define PIDS_GETFLT(e) PIDS_VAL(EU_ ## e, real, stack, info) struct pids_info *info=NULL; struct procps_ns nsp; struct pids_stack *stack; @@ -631,7 +632,7 @@ static struct el * select_procs (int *num) match = 0; else if (opt_ns_pid && ! match_ns (PIDS_GETINT(PID), &nsp)) match = 0; - else if (opt_older && PIDS_GETULL(ELAPSED) < opt_older) + else if (opt_older && (int)PIDS_GETFLT(ELAPSED) < opt_older) match = 0; else if (opt_term) match = match_strlist(PIDS_GETSTR(TTYNAME), opt_term);