aboutsummaryrefslogtreecommitdiff
path: root/sysutils/xfce4-genmon-plugin/files/patch-panel-plugin__cmdspawn.c
diff options
context:
space:
mode:
authorEmanuel Haupt <ehaupt@FreeBSD.org>2010-11-07 15:40:44 +0000
committerEmanuel Haupt <ehaupt@FreeBSD.org>2010-11-07 15:40:44 +0000
commitb385d23060e90d6125b8c0e254e5c6a70e0ac5f4 (patch)
treed329794d647dd88311372605aa3173e6c40bc4cd /sysutils/xfce4-genmon-plugin/files/patch-panel-plugin__cmdspawn.c
parent7f2ca377b50c79a5154d537c07efce7ab59352ed (diff)
downloadports-b385d23060e90d6125b8c0e254e5c6a70e0ac5f4.tar.gz
ports-b385d23060e90d6125b8c0e254e5c6a70e0ac5f4.zip
Notes
Diffstat (limited to 'sysutils/xfce4-genmon-plugin/files/patch-panel-plugin__cmdspawn.c')
-rw-r--r--sysutils/xfce4-genmon-plugin/files/patch-panel-plugin__cmdspawn.c33
1 files changed, 33 insertions, 0 deletions
diff --git a/sysutils/xfce4-genmon-plugin/files/patch-panel-plugin__cmdspawn.c b/sysutils/xfce4-genmon-plugin/files/patch-panel-plugin__cmdspawn.c
new file mode 100644
index 000000000000..a7a3480187b2
--- /dev/null
+++ b/sysutils/xfce4-genmon-plugin/files/patch-panel-plugin__cmdspawn.c
@@ -0,0 +1,33 @@
+--- ./panel-plugin/cmdspawn.c.orig 2007-11-23 16:32:40.000000000 +0100
++++ ./panel-plugin/cmdspawn.c 2010-11-07 11:29:03.000000000 +0100
+@@ -184,6 +184,7 @@
+ return (-1);
+ case 0:
+ /* Redirect stdout/stderr to associated pipe's write-ends */
++ close(0); /* stdin is not used in child */
+ for (i = 0; i < OUT_ERR; i++) {
+ j = i + 1; // stdout/stderr file descriptor
+ close (j);
+@@ -199,6 +200,9 @@
+ exit (-1);
+ }
+
++ for (i = 0; i < OUT_ERR; i++)
++ close (aaiPipe[i][WR]); /* close write end of pipes in parent */
++
+ /* Wait for child completion */
+ if (wait == 1)
+ {
+@@ -231,10 +235,9 @@
+ }
+
+ End:
+- /* Close created pipes */
++ /* Close read end of pipes */
+ for (i = 0; i < OUT_ERR; i++)
+- for (j = 0; j < RD_WR; j++)
+- close (aaiPipe[i][j]);
++ close (aaiPipe[i][RD]);
+
+ return (-fError);
+ }// Spawn()