Module Name:    src
Committed By:   rillig
Date:           Sat Jul  3 20:43:35 UTC 2021

Modified Files:
        src/usr.bin/xlint/lint1: main1.c

Log Message:
lint: make stdout unbuffered in debug mode

Some debug log messages are on stdout, others on stderr.  Make sure that
they occur in the correct order, even when the output is redirected.


To generate a diff of this commit:
cvs rdiff -u -r1.46 -r1.47 src/usr.bin/xlint/lint1/main1.c

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/xlint/lint1/main1.c
diff -u src/usr.bin/xlint/lint1/main1.c:1.46 src/usr.bin/xlint/lint1/main1.c:1.47
--- src/usr.bin/xlint/lint1/main1.c:1.46	Sun Jun 27 18:48:45 2021
+++ src/usr.bin/xlint/lint1/main1.c	Sat Jul  3 20:43:35 2021
@@ -1,4 +1,4 @@
-/*	$NetBSD: main1.c,v 1.46 2021/06/27 18:48:45 rillig Exp $	*/
+/*	$NetBSD: main1.c,v 1.47 2021/07/03 20:43:35 rillig Exp $	*/
 
 /*
  * Copyright (c) 1994, 1995 Jochen Pohl
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #if defined(__RCSID) && !defined(lint)
-__RCSID("$NetBSD: main1.c,v 1.46 2021/06/27 18:48:45 rillig Exp $");
+__RCSID("$NetBSD: main1.c,v 1.47 2021/07/03 20:43:35 rillig Exp $");
 #endif
 
 #include <sys/types.h>
@@ -254,6 +254,8 @@ main(int argc, char *argv[])
 	/* initialize output */
 	outopen(argv[1]);
 
+	if (dflag)
+		setvbuf(stdout, NULL, _IONBF, 0);
 #ifdef YYDEBUG
 	if (yflag)
 		yydebug = 1;

Reply via email to