summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Frysinger <vapier@gentoo.org>2005-04-29 23:06:25 +0000
committerMike Frysinger <vapier@gentoo.org>2005-04-29 23:06:25 +0000
commite30ddd0fcfe4860e1e529be1e614083a3ca66f0a (patch)
treeaa3a9d2e1049cc1ce23acb5b5fe5b3afbfe955a9 /sys-process/psmisc
parentStable on sparc (diff)
downloadgentoo-2-e30ddd0fcfe4860e1e529be1e614083a3ca66f0a.tar.gz
gentoo-2-e30ddd0fcfe4860e1e529be1e614083a3ca66f0a.tar.bz2
gentoo-2-e30ddd0fcfe4860e1e529be1e614083a3ca66f0a.zip
Add a patch to use valid C98/C99 scanf (i.e. fix pstree for uClibc).
(Portage version: 2.0.51.20-r5)
Diffstat (limited to 'sys-process/psmisc')
-rw-r--r--sys-process/psmisc/ChangeLog8
-rw-r--r--sys-process/psmisc/files/psmisc-21.6-scanf.patch50
-rw-r--r--sys-process/psmisc/psmisc-21.6.ebuild3
3 files changed, 58 insertions, 3 deletions
diff --git a/sys-process/psmisc/ChangeLog b/sys-process/psmisc/ChangeLog
index 13c2de35f535..a938db9cd2b3 100644
--- a/sys-process/psmisc/ChangeLog
+++ b/sys-process/psmisc/ChangeLog
@@ -1,6 +1,10 @@
# ChangeLog for sys-process/psmisc
-# Copyright 2002-2005 Gentoo Foundation; Distributed under the GPL v2
-# $Header: /var/cvsroot/gentoo-x86/sys-process/psmisc/ChangeLog,v 1.8 2005/04/09 13:23:40 corsair Exp $
+# Copyright 1999-2005 Gentoo Foundation; Distributed under the GPL v2
+# $Header: /var/cvsroot/gentoo-x86/sys-process/psmisc/ChangeLog,v 1.9 2005/04/29 23:06:25 vapier Exp $
+
+ 29 Apr 2005; Mike Frysinger <vapier@gentoo.org>
+ +files/psmisc-21.6-scanf.patch, psmisc-21.6.ebuild:
+ Add a patch to use valid C98/C99 scanf (i.e. fix pstree for uClibc).
09 Apr 2005; Markus Rothe <corsair@gentoo.org> psmisc-21.5.ebuild:
Stable on ppc64
diff --git a/sys-process/psmisc/files/psmisc-21.6-scanf.patch b/sys-process/psmisc/files/psmisc-21.6-scanf.patch
new file mode 100644
index 000000000000..18e18aa29149
--- /dev/null
+++ b/sys-process/psmisc/files/psmisc-21.6-scanf.patch
@@ -0,0 +1,50 @@
+Fix sscanf() invocation to be C98/C99 compliant. Most people don't
+notice because glibc isn't C98/C99 compliant in this respect, but
+some of us use libc's which are :).
+
+to be more specific, mjn3 of uClibc writes:
+Both C99 and C89 state that the %c conversion for scanf reads the
+exact number of bytes specified by the optional field width (or 1
+if not specified). There is an argument that perhaps the specified
+width should be treated as an upper bound, based on some historical
+use. Glibc does not obey this specification nor mention it in any
+compliance documentation.
+
+Also, the first hunk is to fix segfaults that may arise from
+running pstree with an user argument but find_proc(1) is NULL.
+This normally doesn't occur, but it is possible:
+vapier@uclibc-nemo 0 src $ pstree vapier
+Segmentation fault
+
+Mike Frysinger <vapier@gentoo.org>
+
+Index: src/pstree.c
+===================================================================
+RCS file: /cvsroot/psmisc/psmisc/src/pstree.c,v
+retrieving revision 1.23
+diff -u -r1.23 pstree.c
+--- src/pstree.c 22 Mar 2005 00:57:20 -0000 1.23
++++ src/pstree.c 29 Apr 2005 23:01:41 -0000
+@@ -531,6 +531,9 @@
+ {
+ const CHILD *walk;
+
++ if (!current)
++ return;
++
+ if (current->uid == uid)
+ {
+ if (dumped)
+@@ -608,11 +611,10 @@
+ {
+ memset(comm, '\0', COMM_LEN+1);
+ tmpptr = strrchr(readbuf, ')'); /* find last ) */
+- *tmpptr = '\0';
+ /* We now have readbuf with pid and cmd, and tmpptr+2
+ * with the rest */
+ /*printf("readbuf: %s\n", readbuf);*/
+- if (sscanf(readbuf, "%*d (%15c", comm) == 1)
++ if (sscanf(readbuf, "%*d (%[^)]", comm) == 1)
+ {
+ /*printf("tmpptr: %s\n", tmpptr+2);*/
+ if (sscanf(tmpptr+2, "%*c %d", &ppid) == 1)
diff --git a/sys-process/psmisc/psmisc-21.6.ebuild b/sys-process/psmisc/psmisc-21.6.ebuild
index 8943e44f824e..f612950a5db4 100644
--- a/sys-process/psmisc/psmisc-21.6.ebuild
+++ b/sys-process/psmisc/psmisc-21.6.ebuild
@@ -1,6 +1,6 @@
# Copyright 1999-2005 Gentoo Foundation
# Distributed under the terms of the GNU General Public License v2
-# $Header: /var/cvsroot/gentoo-x86/sys-process/psmisc/psmisc-21.6.ebuild,v 1.1 2005/03/14 05:44:38 vapier Exp $
+# $Header: /var/cvsroot/gentoo-x86/sys-process/psmisc/psmisc-21.6.ebuild,v 1.2 2005/04/29 23:06:25 vapier Exp $
inherit eutils
@@ -28,6 +28,7 @@ src_unpack() {
epatch "${FILESDIR}"/${SELINUX_PATCH}
libtoolize --copy --force
fi
+ epatch "${FILESDIR}"/${P}-scanf.patch
epatch "${FILESDIR}"/${P}-nonls.patch
epunt_cxx #73632
}