From f7212dd173bb267c4d3584f1be387349ba851fee Mon Sep 17 00:00:00 2001 From: Leah Neukirchen Date: Fri, 5 May 2023 22:58:58 +0200 Subject: cleanup --- px.c | 14 +++++--------- 1 file changed, 5 insertions(+), 9 deletions(-) diff --git a/px.c b/px.c index 5f8031c..e86885d 100644 --- a/px.c +++ b/px.c @@ -99,17 +99,13 @@ main(int argc, char *argv[]) EU_VM_RSS, EU_VM_SIZE, }; - if (procps_pids_new(&Pids_info, items, 12) < 0) { + if (procps_pids_new(&Pids_info, items, 12) < 0) abort(); - } - struct pids_fetch *reap; - if (!(reap = procps_pids_reap(Pids_info, PIDS_FETCH_TASKS_ONLY))) { + struct pids_fetch *reap = procps_pids_reap(Pids_info, + PIDS_FETCH_TASKS_ONLY); + if (!reap) abort(); - } - -// result = readproctab(PROC_FILLCOM | PROC_FILLUSR | -// PROC_FILLSTAT | PROC_FILLSTATUS); int matched = 0; @@ -190,7 +186,7 @@ match: if (PIDS_GETSTR_V(CMDLINE_V)) for (int j = 0; PIDS_GETSTR_V(CMDLINE_V)[j]; j++) printf(" %s", PIDS_GETSTR_V(CMDLINE_V)[j]); - else // kernel threads + else // kernel threads printf(" [%s]", PIDS_GETSTR(CMD)); if (PIDS_GETCHR(STATE) == 'Z') printf(" "); -- cgit 1.4.1