c3c8fc36f3
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]
14 lines
399 B
C
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) {
|