summaryrefslogtreecommitdiff
path: root/core/procps/procps-3.2.7-longcmd.patch
diff options
context:
space:
mode:
authorParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
committerParabola <dev@list.parabolagnulinux.org>2011-04-05 14:26:38 +0000
commit415856bdd4f48ab4f2732996f0bae58595092bbe (patch)
treeede2018b591f6dfb477fe9341ba17b9bc000fab9 /core/procps/procps-3.2.7-longcmd.patch
Tue Apr 5 14:26:38 UTC 2011
Diffstat (limited to 'core/procps/procps-3.2.7-longcmd.patch')
-rw-r--r--core/procps/procps-3.2.7-longcmd.patch22
1 files changed, 22 insertions, 0 deletions
diff --git a/core/procps/procps-3.2.7-longcmd.patch b/core/procps/procps-3.2.7-longcmd.patch
new file mode 100644
index 000000000..7c4fdca36
--- /dev/null
+++ b/core/procps/procps-3.2.7-longcmd.patch
@@ -0,0 +1,22 @@
+--- procps-3.2.7/proc/readproc.c.kzak 2006-06-16 10:18:13.000000000 +0200
++++ procps-3.2.7/proc/readproc.c 2006-09-27 11:25:13.000000000 +0200
+@@ -432,14 +432,17 @@
+ if(fd==-1) return NULL;
+
+ /* read whole file into a memory buffer, allocating as we go */
+- while ((n = read(fd, buf, sizeof buf - 1)) > 0) {
++ while ((n = read(fd, buf, sizeof buf - 1)) >= 0) {
+ if (n < (int)(sizeof buf - 1))
+ end_of_file = 1;
+- if (n == 0 && rbuf == 0)
++ if (n == 0 && rbuf == 0) {
++ close(fd);
+ return NULL; /* process died between our open and read */
++ }
+ if (n < 0) {
+ if (rbuf)
+ free(rbuf);
++ close(fd);
+ return NULL; /* read error */
+ }
+ if (end_of_file && buf[n-1]) /* last read char not null */