]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Make build-many-glibcs.py flush stdout before execv.
authorJoseph Myers <joseph@codesourcery.com>
Fri, 16 Dec 2016 16:17:13 +0000 (16:17 +0000)
committerJoseph Myers <joseph@codesourcery.com>
Fri, 16 Dec 2016 16:17:13 +0000 (16:17 +0000)
When build-many-glibcs.py re-execs itself with execv, any buffered
output on stdout may be lost (in particular, messages intended to go
to a bot's log about the re-exec taking place).  This patch makes it
flush stdout before execv, similar to the flush before running a
subprocess from the bot that is done to ensure output appears in the
right order.

* scripts/build-many-glibcs.py (Context.exec_self): Flush stdout
before calling execv.

ChangeLog
scripts/build-many-glibcs.py

index 628540538b102317ddb523c4cc0e9d737ec70e23..b3f9de28ee662a8fa8ea0c55bdcd2df7228bf342 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2016-12-16  Joseph Myers  <joseph@codesourcery.com>
+
+       * scripts/build-many-glibcs.py (Context.exec_self): Flush stdout
+       before calling execv.
+
 2016-12-16  Adhemerval Zanella  <adhemerval.zanella@linaro.org>
 
        [BZ# 20971]
index a5f71199bbb167ec8b6e49ce921d0ff65d5b0324..94017096b5288bd558ca182b915e961e91a21bc6 100755 (executable)
@@ -93,6 +93,7 @@ class Context(object):
 
     def exec_self(self):
         """Re-execute this script with the same arguments."""
+        sys.stdout.flush()
         os.execv(sys.executable, [sys.executable] + sys.argv)
 
     def get_build_triplet(self):