]> git.donarmstrong.com Git - lilypond.git/commitdiff
Flush all ports after each file, flush stdout after displaying all options
authorReinhold Kainhofer <reinhold@kainhofer.com>
Sat, 3 Sep 2011 23:50:16 +0000 (01:50 +0200)
committerReinhold Kainhofer <reinhold@kainhofer.com>
Sat, 10 Sep 2011 09:20:55 +0000 (11:20 +0200)
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
scm/lily.scm

index 1071d14d7d7f43497a23f0e666df906406b12326..ca22a2dff405b536a2bdfed373cc3c53e854cd35 100644 (file)
@@ -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;
 }
index f7e53cb1793838947ea2072f9b8ae75c9dc5ffce..bbea5afab996462f9eedb9a6ee3613f65581ce5a 100644 (file)
@@ -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.