cmd/dist: force line-buffering stdout/stderr on Unix

If stdout and stderr are indeed the same file (not a tty), which is
        often the case, fully-buffered stdout will make it harder to see
        progresses, for example, ./make.bash 2>&1 | tee log

R=r, rsc
CC=golang-dev
https://golang.org/cl/5700070
This commit is contained in:
Shenghou Ma 2012-02-29 02:22:28 +08:00
parent fb1a5fcacf
commit 26daf6a03f

3
src/cmd/dist/unix.c vendored
View File

@ -641,6 +641,9 @@ main(int argc, char **argv)
Buf b; Buf b;
struct utsname u; struct utsname u;
setvbuf(stdout, nil, _IOLBF, 0);
setvbuf(stderr, nil, _IOLBF, 0);
binit(&b); binit(&b);
slash = "/"; slash = "/";