In ExternalProgram::close discard any output instead of simply closing the pipe.
authorMichael Andres <ma@suse.de>
Wed, 22 Jul 2009 16:31:38 +0000 (18:31 +0200)
committerMichael Andres <ma@suse.de>
Wed, 22 Jul 2009 16:31:38 +0000 (18:31 +0200)
zypp/ExternalProgram.cc
zypp/ExternalProgram.h

index 27c4cba..8da0779 100644 (file)
@@ -86,7 +86,7 @@ namespace zypp {
         }
         start_program (argvp, environment, stderr_disp, stderr_fd, default_locale, rootdir);
     }
-    
+
 
     ExternalProgram::ExternalProgram (const Arguments &argv,
                                       const Environment & environment,
@@ -113,7 +113,7 @@ namespace zypp {
         start_program (argvp, environment, stderr_disp, stderr_fd, default_locale, rootdir);
 
     }
-    
+
 
 
 
@@ -367,10 +367,14 @@ namespace zypp {
     {
       if (pid > 0)
       {
-       ExternalDataSource::close();
+        setBlocking( true );
+        while ( receiveLine().length() )
+          ; // discard any output instead of closing the pipe
+       //ExternalDataSource::close();
+
        // Wait for child to exit
        int ret;
-          int status = 0;
+        int status = 0;
        do
        {
            ret = waitpid(pid, &status, 0);
index e2307ed..305e03f 100644 (file)
@@ -129,6 +129,7 @@ namespace zypp {
 
       ~ExternalProgram();
 
+      /** Wait for the progamm to complete. */
       int close();
 
       /**