freebsd-ports/sysutils/pstree/files/patch-pstree.c
Kris Kennaway c3c8fc36f3 Update to pstree 2.20
Don't go into an infinite loop when encountering a zombie process on 5.x [1]

PR:		48852 [1]
Submitted by:	Joel Ray Holveck <joelh@piqnet.org> [1], fuyuki@mj.0038.net [1]
2003-08-10 07:05:07 +00:00

14 lines
399 B
C

--- pstree.c.orig
+++ pstree.c
@@ -655,8 +655,9 @@
sprintf(nhead, "%s%s ", head,
head[0] == '\0' ? "" : EXIST(P[idx].sister) ? C->bar : " ");
- for (child = P[idx].child; EXIST(child); child = P[child].sister)
- PrintTree(child, nhead);
+ if (P[idx].pid)
+ for (child = P[idx].child; EXIST(child); child = P[child].sister)
+ PrintTree(child, nhead);
}
void Usage(void) {