ref: refs/heads/ma-misc
commit 4ab56b1d3aa8146031aff453ccc79f7054ad8036
Author: Michael Andres
Date: Wed Jul 22 18:31:38 2009 +0200
In ExternalProgram::close discard any output instead of simply closing the pipe.
---
zypp/ExternalProgram.cc | 12 ++++++++----
zypp/ExternalProgram.h | 1 +
2 files changed, 9 insertions(+), 4 deletions(-)
diff --git a/zypp/ExternalProgram.cc b/zypp/ExternalProgram.cc
index 27c4cba..8da0779 100644
--- a/zypp/ExternalProgram.cc
+++ b/zypp/ExternalProgram.cc
@@ -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);
diff --git a/zypp/ExternalProgram.h b/zypp/ExternalProgram.h
index e2307ed..305e03f 100644
--- a/zypp/ExternalProgram.h
+++ b/zypp/ExternalProgram.h
@@ -129,6 +129,7 @@ namespace zypp {
~ExternalProgram();
+ /** Wait for the progamm to complete. */
int close();
/**
--
To unsubscribe, e-mail: zypp-commit+unsubscribe@opensuse.org
For additional commands, e-mail: zypp-commit+help@opensuse.org