summaryrefslogtreecommitdiffstats
path: root/iutil.py
diff options
context:
space:
mode:
authorEric Kerin <eric_kerin@jabil.com>2009-07-14 09:09:32 -0400
committerPeter Jones <pjones@redhat.com>2009-07-16 11:13:57 -0400
commit84eb43117da7d22e23d6b007622b68d946972bf4 (patch)
treec8ac811c801f245fa9d1b60fb35d8caf37b31ab0 /iutil.py
parent4aa290945425bea0733f73259b9adf4d6a95c6f5 (diff)
downloadanaconda-84eb43117da7d22e23d6b007622b68d946972bf4.tar.gz
anaconda-84eb43117da7d22e23d6b007622b68d946972bf4.tar.xz
anaconda-84eb43117da7d22e23d6b007622b68d946972bf4.zip
Don't show formatting progress bar after mkfs has exited.
mke2fs will finish it's work quickly, and anaconda will spend quite sometime reading in the output, and updating the progress dialog in certain cases - the attached patch adds a check to the read/progress loop to check to see if the process has finished, and jumps out early if that's the case.
Diffstat (limited to 'iutil.py')
-rw-r--r--iutil.py13
1 files changed, 12 insertions, 1 deletions
diff --git a/iutil.py b/iutil.py
index 49509e993..ec25adba4 100644
--- a/iutil.py
+++ b/iutil.py
@@ -236,11 +236,22 @@ def execWithPulseProgress(command, argv, stdin = None, stdout = None,
runningLog.write(s)
if progress: progress.pulse()
+ # break out early if the sub-process changes status.
+ # no need to flush the stream if the process has exited
+ try:
+ (pid, status) = os.waitpid(childpid,os.WNOHANG)
+ if pid != 0:
+ break
+ except OSError as e:
+ log.critical("exception from waitpid: %s %s" %(e.errno, e.strerror))
+
if len(s) < 1:
break
try:
- (pid, status) = os.waitpid(childpid, 0)
+ #if we didn't already get our child's exit status above, do so now.
+ if not pid:
+ (pid, status) = os.waitpid(childpid, 0)
except OSError as e:
log.critical("exception from waitpid: %s %s" %(e.errno, e.strerror))