]> Cypherpunks repositories - gostls13.git/commitdiff
cmd/dist: force line-buffering stdout/stderr on Unix
authorShenghou Ma <minux.ma@gmail.com>
Tue, 28 Feb 2012 18:22:28 +0000 (02:22 +0800)
committerShenghou Ma <minux.ma@gmail.com>
Tue, 28 Feb 2012 18:22:28 +0000 (02:22 +0800)
        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

src/cmd/dist/unix.c

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