Module Name: src
Committed By: sjg
Date: Sun Oct 25 05:24:44 UTC 2015
Modified Files:
src/usr.bin/make: main.c
src/usr.bin/make/unit-tests: doterror.exp
Log Message:
PrintOnError: fflush stdout before running .ERROR
produces more consistent results in unit-tests.
To generate a diff of this commit:
cvs rdiff -u -r1.234 -r1.235 src/usr.bin/make/main.c
cvs rdiff -u -r1.1 -r1.2 src/usr.bin/make/unit-tests/doterror.exp
Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.
Modified files:
Index: src/usr.bin/make/main.c
diff -u src/usr.bin/make/main.c:1.234 src/usr.bin/make/main.c:1.235
--- src/usr.bin/make/main.c:1.234 Sun Oct 11 04:51:24 2015
+++ src/usr.bin/make/main.c Sun Oct 25 05:24:44 2015
@@ -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 @@ __COPYRIGHT("@(#) Copyright (c) 1988, 19
#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 @@ PrintOnError(GNode *gn, const char *s)
printf("%s", cp);
free(cp);
}
+ fflush(stdout);
+
/*
* Finally, see if there is a .ERROR target, and run it if so.
*/
Index: src/usr.bin/make/unit-tests/doterror.exp
diff -u src/usr.bin/make/unit-tests/doterror.exp:1.1 src/usr.bin/make/unit-tests/doterror.exp:1.2
--- src/usr.bin/make/unit-tests/doterror.exp:1.1 Thu Aug 21 13:44:51 2014
+++ src/usr.bin/make/unit-tests/doterror.exp Sun Oct 25 05:24:44 2015
@@ -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