Buffer warning/error outputs to avoid interlacing in parallel mk. [rsc] --rw-rw-r-- M 323293 glenda sys 12071 Nov 4 08:20 sys/src/cmd/cc/cc.h /n/sourcesdump/2005/1104/plan9/sys/src/cmd/cc/cc.h:449,454 - /n/sourcesdump/2005/1105/plan9/sys/src/cmd/cc/cc.h:449,455 EXTERN Node* nodproto; EXTERN Node* nodcast; EXTERN Biobuf outbuf; + EXTERN Biobuf diagbuf; EXTERN char* outfile; EXTERN char* pathname; EXTERN int peekc; [rsc] --rw-rw-r-- M 323293 glenda sys 34138 Nov 4 08:20 sys/src/cmd/cc/sub.c /n/sourcesdump/2005/1104/plan9/sys/src/cmd/cc/sub.c:1159,1168 - /n/sourcesdump/2005/1105/plan9/sys/src/cmd/cc/sub.c:1159,1170 va_start(arg, fmt); vseprint(buf, buf+sizeof(buf), fmt, arg); va_end(arg); - print("%L %s\n", (n==Z)? nearln: n->lineno, buf); + Bprint(&diagbuf, "%L %s\n", (n==Z)? nearln: n->lineno, buf); - if(debug['X']) + if(debug['X']){ + Bflush(&diagbuf); abort(); + } if(n != Z) if(debug['v']) prtree(n, "diagnostic"); /n/sourcesdump/2005/1104/plan9/sys/src/cmd/cc/sub.c:1169,1175 - /n/sourcesdump/2005/1105/plan9/sys/src/cmd/cc/sub.c:1171,1177 nerrors++; if(nerrors > 10) { - print("too many errors\n"); + Bprint(&diagbuf, "too many errors\n"); errorexit(); } } /n/sourcesdump/2005/1104/plan9/sys/src/cmd/cc/sub.c:1181,1191 - /n/sourcesdump/2005/1105/plan9/sys/src/cmd/cc/sub.c:1183,1193 va_list arg; if(debug['w']) { - print("warning: "); + Bprint(&diagbuf, "warning: "); va_start(arg, fmt); vseprint(buf, buf+sizeof(buf), fmt, arg); va_end(arg); - print("%L %s\n", (n==Z)? nearln: n->lineno, buf); + Bprint(&diagbuf, "%L %s\n", (n==Z)? nearln: n->lineno, buf); if(n != Z) if(debug['v']) /n/sourcesdump/2005/1104/plan9/sys/src/cmd/cc/sub.c:1209,1218 - /n/sourcesdump/2005/1105/plan9/sys/src/cmd/cc/sub.c:1211,1220 va_start(arg, fmt); vseprint(buf, buf+sizeof(buf), fmt, arg); va_end(arg); - print("%L %s\n", lineno, buf); + Bprint(&diagbuf, "%L %s\n", lineno, buf); nerrors++; if(nerrors > 10) { - print("too many errors\n"); + Bprint(&diagbuf, "too many errors\n"); errorexit(); } } /n/sourcesdump/2005/1104/plan9/sys/src/cmd/cc/sub.c:1226,1235 - /n/sourcesdump/2005/1105/plan9/sys/src/cmd/cc/sub.c:1228,1239 va_start(arg, fmt); vseprint(buf, buf+sizeof(buf), fmt, arg); va_end(arg); - print("%L %s\n", (n==Z)? nearln: n->lineno, buf); + Bprint(&diagbuf, "%L %s\n", (n==Z)? nearln: n->lineno, buf); - if(debug['X']) + if(debug['X']){ + Bflush(&diagbuf); abort(); + } if(n != Z) if(debug['v']) prtree(n, "diagnostic");