Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.bin/make PrintOnError: fflush stdout before running .ERROR



details:   https://anonhg.NetBSD.org/src/rev/666dd92ee8d3
branches:  trunk
changeset: 341191:666dd92ee8d3
user:      sjg <sjg%NetBSD.org@localhost>
date:      Sun Oct 25 05:24:44 2015 +0000

description:
PrintOnError: fflush stdout before running .ERROR

produces more consistent results in unit-tests.

diffstat:

 usr.bin/make/main.c                  |  8 +++++---
 usr.bin/make/unit-tests/doterror.exp |  2 +-
 2 files changed, 6 insertions(+), 4 deletions(-)

diffs (50 lines):

diff -r 60a5ccf130ce -r 666dd92ee8d3 usr.bin/make/main.c
--- a/usr.bin/make/main.c       Sun Oct 25 02:47:17 2015 +0000
+++ b/usr.bin/make/main.c       Sun Oct 25 05:24:44 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.234 2015/10/11 04:51:24 sjg Exp $   */
+/*     $NetBSD: main.c,v 1.235 2015/10/25 05:24:44 sjg Exp $   */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.234 2015/10/11 04:51:24 sjg Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.235 2015/10/25 05:24:44 sjg Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
@@ -81,7 +81,7 @@
 #if 0
 static char sccsid[] = "@(#)main.c     8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: main.c,v 1.234 2015/10/11 04:51:24 sjg Exp $");
+__RCSID("$NetBSD: main.c,v 1.235 2015/10/25 05:24:44 sjg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1868,6 +1868,8 @@
            printf("%s", cp);
        free(cp);
     }
+    fflush(stdout);
+
     /*
      * Finally, see if there is a .ERROR target, and run it if so.
      */
diff -r 60a5ccf130ce -r 666dd92ee8d3 usr.bin/make/unit-tests/doterror.exp
--- a/usr.bin/make/unit-tests/doterror.exp      Sun Oct 25 02:47:17 2015 +0000
+++ b/usr.bin/make/unit-tests/doterror.exp      Sun Oct 25 05:24:44 2015 +0000
@@ -1,9 +1,9 @@
 At first, I am
 happy
 and now: sad
-.ERROR: Looks like 'sad' is upset.
 *** Error code 1
 
 Stop.
 make: stopped in unit-tests
+.ERROR: Looks like 'sad' is upset.
 exit status 1



Home | Main Index | Thread Index | Old Index