From c3c8fc36f3ef2776493b8d909e41457109b64aff Mon Sep 17 00:00:00 2001 From: Kris Kennaway Date: Sun, 10 Aug 2003 07:05:07 +0000 Subject: [PATCH] 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 [1], fuyuki@mj.0038.net [1] --- sysutils/pstree/Makefile | 8 +++++--- sysutils/pstree/distinfo | 2 +- sysutils/pstree/files/patch-pstree.c | 14 ++++++++++++++ 3 files changed, 20 insertions(+), 4 deletions(-) create mode 100644 sysutils/pstree/files/patch-pstree.c diff --git a/sysutils/pstree/Makefile b/sysutils/pstree/Makefile index 522b54f5df35..7ac9e5770922 100644 --- a/sysutils/pstree/Makefile +++ b/sysutils/pstree/Makefile @@ -6,13 +6,15 @@ # PORTNAME= pstree -PORTVERSION= 2.17 -CATEGORIES= sysutils -MASTER_SITES= http://www.go.dlr.de/fresh/unix/src/misc/ +PORTVERSION= 2.20 +CATEGORIES= sysutils +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 diff --git a/sysutils/pstree/distinfo b/sysutils/pstree/distinfo index 9b7cf5c477d6..45ca55445e52 100644 --- a/sysutils/pstree/distinfo +++ b/sysutils/pstree/distinfo @@ -1 +1 @@ -MD5 (pstree-2.17.tar.gz) = 15bac1ebc32c70e9eab803c028d04bb6 +MD5 (pstree-2.20.tar.gz) = df3deb4ac88841d3edb466272c7c1343 diff --git a/sysutils/pstree/files/patch-pstree.c b/sysutils/pstree/files/patch-pstree.c new file mode 100644 index 000000000000..122956e3f867 --- /dev/null +++ b/sysutils/pstree/files/patch-pstree.c @@ -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) {