summaryrefslogtreecommitdiffstats
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
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.
-rwxr-xr-xgui.py5
-rw-r--r--iutil.py13
2 files changed, 16 insertions, 2 deletions
diff --git a/gui.py b/gui.py
index 671bb580a..4def03f59 100755
--- a/gui.py
+++ b/gui.py
@@ -521,7 +521,10 @@ class ProgressWindow:
return
self.progress.set_pulse_step(self.updpct)
self.lastUpdate = now
- # if we've had a largish gap, some smoothing does actually help.
+ # if we've had a largish gap, some smoothing does actually help,
+ # but don't go crazy
+ if delta > 2:
+ delta=2
while delta > 0:
self.progress.pulse()
processEvents()
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))