From 36820ce9ceb3c37c3e9c8f1bdd0ca04da730deb4 Mon Sep 17 00:00:00 2001 From: Joseph Myers Date: Fri, 16 Dec 2016 16:17:13 +0000 Subject: [PATCH] Make build-many-glibcs.py flush stdout before execv. 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 | 5 +++++ scripts/build-many-glibcs.py | 1 + 2 files changed, 6 insertions(+) diff --git a/ChangeLog b/ChangeLog index 628540538b..b3f9de28ee 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2016-12-16 Joseph Myers + + * scripts/build-many-glibcs.py (Context.exec_self): Flush stdout + before calling execv. + 2016-12-16 Adhemerval Zanella [BZ# 20971] diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py index a5f71199bb..94017096b5 100755 --- a/scripts/build-many-glibcs.py +++ b/scripts/build-many-glibcs.py @@ -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):