Mailinglist Archive: zypp-commit (325 mails)

< Previous Next >
[zypp-commit] r7301 - /trunk/zypper/src/zypp-checkpatches-wrapper.c
  • From: tgoettlicher@xxxxxxxxxxxxxxxx
  • Date: Wed, 19 Sep 2007 07:17:35 -0000
  • Message-id: <20070919071735.B13E91758C@xxxxxxxxxxxxxxxx>
Author: tgoettlicher
Date: Wed Sep 19 09:17:35 2007
New Revision: 7301

URL: http://svn.opensuse.org/viewcvs/zypp?rev=7301&view=rev
Log:
check if stdout/stderr file descriptors are open (#325556)


Modified:
    trunk/zypper/src/zypp-checkpatches-wrapper.c

Modified: trunk/zypper/src/zypp-checkpatches-wrapper.c
URL: http://svn.opensuse.org/viewcvs/zypp/trunk/zypper/src/zypp-checkpatches-wrapper.c?rev=7301&r1=7300&r2=7301&view=diff
==============================================================================
--- trunk/zypper/src/zypp-checkpatches-wrapper.c (original)
+++ trunk/zypper/src/zypp-checkpatches-wrapper.c Wed Sep 19 09:17:35 2007
@@ -68,6 +68,29 @@
 
     umask(0022);
 
+
+
+    /* check if stdout/stderr file descriptors are open */
+    while (1) {
+        int     fd;
+
+        fd = open("/dev/null", O_RDWR);
+        if (fd < 0)
+       {
+               fprintf (stdout, "<?xml version='1.0'?>\n");
+               fprintf (stdout, "<stream>\n");
+               fprintf (stdout, "<message type=\"error\">stdout/stderr file descriptores are not open</message>\n");
+               fprintf (stdout, "</stream>\n");
+               return(WRAPPER_ERROR);
+       }
+        if (fd > 2) {
+            close(fd);
+            break;
+        }
+    }
+
+
+
     /* execute the real application */
     execl (app, app, arg1, arg2, arg3, arg4, (char *) NULL);
 

--
To unsubscribe, e-mail: zypp-commit+unsubscribe@xxxxxxxxxxxx
For additional commands, e-mail: zypp-commit+help@xxxxxxxxxxxx

< Previous Next >
This Thread
  • No further messages