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]
This commit is contained in:
Kris Kennaway 2003-08-10 07:05:07 +00:00
parent 1839396e48
commit c3c8fc36f3
Notes: svn2git 2021-03-31 03:12:20 +00:00
svn path=/head/; revision=86704
3 changed files with 20 additions and 4 deletions

View file

@ -6,13 +6,15 @@
#
PORTNAME= pstree
PORTVERSION= 2.17
PORTVERSION= 2.20
CATEGORIES= sysutils
MASTER_SITES= http://www.go.dlr.de/fresh/unix/src/misc/
MASTER_SITES= http://fresh.t-systems-sfr.com/unix/src/misc/
MAINTAINER= kris@FreeBSD.org
COMMENT= List processes as a tree
NO_WRKSUBDIR= yes
do-build:
cd ${WRKDIR} && ${CC} ${CFLAGS} -o pstree pstree.c

View file

@ -1 +1 @@
MD5 (pstree-2.17.tar.gz) = 15bac1ebc32c70e9eab803c028d04bb6
MD5 (pstree-2.20.tar.gz) = df3deb4ac88841d3edb466272c7c1343

View file

@ -0,0 +1,14 @@
--- 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) {