Source-Changes-HG archive

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

[src/trunk]: src/usr.bin/make fflush stdout, before writing to stderr.



details:   https://anonhg.NetBSD.org/src/rev/44fc6317a49e
branches:  trunk
changeset: 754410:44fc6317a49e
user:      sjg <sjg%NetBSD.org@localhost>
date:      Thu Apr 29 23:12:21 2010 +0000

description:
fflush stdout, before writing to stderr.

diffstat:

 usr.bin/make/main.c  |  9 ++++++---
 usr.bin/make/parse.c |  9 ++++++---
 2 files changed, 12 insertions(+), 6 deletions(-)

diffs (101 lines):

diff -r cdc4d0211e4d -r 44fc6317a49e usr.bin/make/main.c
--- a/usr.bin/make/main.c       Thu Apr 29 22:45:40 2010 +0000
+++ b/usr.bin/make/main.c       Thu Apr 29 23:12:21 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: main.c,v 1.183 2010/04/23 00:18:50 sjg Exp $   */
+/*     $NetBSD: main.c,v 1.184 2010/04/29 23:12:21 sjg Exp $   */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,7 +69,7 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: main.c,v 1.183 2010/04/23 00:18:50 sjg Exp $";
+static char rcsid[] = "$NetBSD: main.c,v 1.184 2010/04/29 23:12:21 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.183 2010/04/23 00:18:50 sjg Exp $");
+__RCSID("$NetBSD: main.c,v 1.184 2010/04/29 23:12:21 sjg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -1695,6 +1695,7 @@
        err_file = debug_file;
        if (err_file == stdout)
                err_file = stderr;
+       (void)fflush(stdout);
        for (;;) {
                va_start(ap, fmt);
                fprintf(err_file, "%s: ", progname);
@@ -1729,6 +1730,7 @@
        if (jobsRunning)
                Job_Wait();
 
+       (void)fflush(stdout);
        (void)vfprintf(stderr, fmt, ap);
        va_end(ap);
        (void)fprintf(stderr, "\n");
@@ -1760,6 +1762,7 @@
        va_list ap;
 
        va_start(ap, fmt);
+       (void)fflush(stdout);
        (void)fprintf(stderr, "%s: ", progname);
        (void)vfprintf(stderr, fmt, ap);
        va_end(ap);
diff -r cdc4d0211e4d -r 44fc6317a49e usr.bin/make/parse.c
--- a/usr.bin/make/parse.c      Thu Apr 29 22:45:40 2010 +0000
+++ b/usr.bin/make/parse.c      Thu Apr 29 23:12:21 2010 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: parse.c,v 1.162 2010/04/08 17:41:29 sjg Exp $  */
+/*     $NetBSD: parse.c,v 1.163 2010/04/29 23:12:21 sjg Exp $  */
 
 /*
  * Copyright (c) 1988, 1989, 1990, 1993
@@ -69,14 +69,14 @@
  */
 
 #ifndef MAKE_NATIVE
-static char rcsid[] = "$NetBSD: parse.c,v 1.162 2010/04/08 17:41:29 sjg Exp $";
+static char rcsid[] = "$NetBSD: parse.c,v 1.163 2010/04/29 23:12:21 sjg Exp $";
 #else
 #include <sys/cdefs.h>
 #ifndef lint
 #if 0
 static char sccsid[] = "@(#)parse.c    8.3 (Berkeley) 3/19/94";
 #else
-__RCSID("$NetBSD: parse.c,v 1.162 2010/04/08 17:41:29 sjg Exp $");
+__RCSID("$NetBSD: parse.c,v 1.163 2010/04/29 23:12:21 sjg Exp $");
 #endif
 #endif /* not lint */
 #endif
@@ -451,6 +451,7 @@
        va_list ap;
 
        va_start(ap, fmt);
+       (void)fflush(stdout);
        ParseVErrorInternal(stderr, cfname, clineno, type, fmt, ap);
        va_end(ap);
 
@@ -489,6 +490,7 @@
        }
 
        va_start(ap, fmt);
+       (void)fflush(stdout);
        ParseVErrorInternal(stderr, fname, lineno, type, fmt, ap);
        va_end(ap);
 
@@ -2712,6 +2714,7 @@
     } while (ParseEOF() == CONTINUE);
 
     if (fatals) {
+       (void)fflush(stdout);
        (void)fprintf(stderr,
            "%s: Fatal errors encountered -- cannot continue\n",
            progname);



Home | Main Index | Thread Index | Old Index