summaryrefslogtreecommitdiffstats
path: root/patches/procps-3.2.8/0031-readproc_c.patch
diff options
context:
space:
mode:
Diffstat (limited to 'patches/procps-3.2.8/0031-readproc_c.patch')
-rw-r--r--patches/procps-3.2.8/0031-readproc_c.patch35
1 files changed, 35 insertions, 0 deletions
diff --git a/patches/procps-3.2.8/0031-readproc_c.patch b/patches/procps-3.2.8/0031-readproc_c.patch
new file mode 100644
index 000000000..89c945516
--- /dev/null
+++ b/patches/procps-3.2.8/0031-readproc_c.patch
@@ -0,0 +1,35 @@
+From 49aba46c22ec4af297566165dda611fe6c3c792b Mon Sep 17 00:00:00 2001
+From: http://ftp.de.debian.org/debian/pool/main/p/procps/procps_3.2.8-8.debian.tar.gz <info@debian.org>
+Date: Fri, 19 Mar 2010 21:58:46 +0100
+Subject: [PATCH 31/70] readproc_c
+
+return if unable to open /proc
+---
+ proc/readproc.c | 4 +++-
+ 1 files changed, 3 insertions(+), 1 deletions(-)
+
+diff --git a/proc/readproc.c b/proc/readproc.c
+index 4fad11d..0386a63 100644
+--- a/proc/readproc.c
++++ b/proc/readproc.c
+@@ -173,7 +173,7 @@ ENTER(0x220);
+ // examine a field name (hash and compare)
+ base:
+ if(unlikely(!*S)) break;
+- entry = table[63 & (asso[S[3]] + asso[S[2]] + asso[S[0]])];
++ entry = table[63 & (asso[(int)S[3]] + asso[(int)S[2]] + asso[(int)S[0]])];
+ colon = strchr(S, ':');
+ if(unlikely(!colon)) break;
+ if(unlikely(colon[1]!='\t')) break;
+@@ -942,6 +942,8 @@ proc_t** readproctab(int flags, ...) {
+ else
+ PT = openproc(flags);
+ va_end(ap);
++ if (!PT)
++ return 0;
+ do { /* read table: */
+ tab = xrealloc(tab, (n+1)*sizeof(proc_t*));/* realloc as we go, using */
+ tab[n] = readproc_direct(PT, NULL); /* final null to terminate */
+--
+1.7.0
+