From d6bfed981f663c440475b56995c7f965af16589d Mon Sep 17 00:00:00 2001 From: Reinhold Kainhofer Date: Sun, 4 Sep 2011 01:50:16 +0200 Subject: [PATCH] Flush all ports after each file, flush stdout after displaying all options So far, the output of the safe.ly regtest showed up randomly in some later regtest, because stdout was buffered when redirected to a file. This patch flushes all ports after each processed file (only relevant when multiple files are processed at once). Unfortunately, it seems stdout is not an open Scheme port when Scheme doesn't print anything to stdout. So, when displaying all options, we have to flush stdout directly after printing all options. --- lily/program-option-scheme.cc | 1 + scm/lily.scm | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/lily/program-option-scheme.cc b/lily/program-option-scheme.cc index 1071d14d7d..ca22a2dff4 100644 --- a/lily/program-option-scheme.cc +++ b/lily/program-option-scheme.cc @@ -190,6 +190,7 @@ LY_DEFINE (ly_option_usage, "ly:option-usage", 0, 0, 0, (), { string help = get_help_string (); puts (help.c_str ()); + fflush (stdout); return SCM_UNSPECIFIED; } diff --git a/scm/lily.scm b/scm/lily.scm index f7e53cb179..bbea5afab9 100644 --- a/scm/lily.scm +++ b/scm/lily.scm @@ -861,7 +861,8 @@ PIDs or the number of the process." (ly:set-option 'debug-gc-assert-parsed-dead #f) (if (ly:get-option 'debug-gc) (dump-gc-protects) - (ly:reset-all-fonts)))) + (ly:reset-all-fonts)) + (flush-all-ports))) files) ;; Ensure a notice re failed files is written to aggregate logfile. -- 2.39.2