Sisyphus repository
Last update: 1 october 2023 | SRPMs: 18631 | Visits: 37560033
en ru br
ALT Linux repos
S:4.2.0-alt1
5.0: 3.2-alt1
4.1: 3.1-alt1.M41.1
4.0: 3.0-alt1

Group :: Graphical desktop/XFce
RPM: xfce4-genmon-plugin

 Main   Changelog   Spec   Patches   Sources   Download   Gear   Bugs and FR  Repocop 

Patch: 02_close-unused-pipes.patch
Download


Description: close unused pipes to prevent freezing the UI
Bug: http://bugzilla.xfce.org/show_bug.cgi?id=4036
Author: Steve Tyler <stephent98@hotmail.com>
--- xfce4-genmon-plugin-3.2.orig/panel-plugin/cmdspawn.c	2007-11-23 07:32:40.000000000 -0800
+++ xfce4-genmon-plugin-3.2.new2/panel-plugin/cmdspawn.c	2008-04-28 21:18:28.000000000 -0700
@@ -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()
 
design & coding: Vladimir Lettiev aka crux © 2004-2005, Andrew Avramenko aka liks © 2007-2008
current maintainer: Michael Shigorin