about summary refs log tree commit diff
diff options
context:
space:
mode:
authorLeah Neukirchen <leah@vuxu.org>2023-05-05 22:58:58 +0200
committerLeah Neukirchen <leah@vuxu.org>2023-05-05 22:58:58 +0200
commitf7212dd173bb267c4d3584f1be387349ba851fee (patch)
treeaf33266ecedbad07961a2f878843a67e1e8c5804
parent29098013d88e9829e48aa906558ea8bc60d7260b (diff)
downloadpx-f7212dd173bb267c4d3584f1be387349ba851fee.tar.gz
px-f7212dd173bb267c4d3584f1be387349ba851fee.tar.xz
px-f7212dd173bb267c4d3584f1be387349ba851fee.zip
cleanup libproc2
-rw-r--r--px.c14
1 files 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(" <defunct>");