소스 검색

fflush(stdout) to print line by line if stdout is not a tty

To reproduce the issue:
	$ slstatus -s | tee

then it would print only when the stdout buffer is full, by block
of multiple lines.

fflush() makes sure the line is printed at every loop iteration
master
Josuah Demangeon 6 년 전
committed by Aaron Marcher
부모
커밋
7e29da026b
1개의 변경된 파일1개의 추가작업 그리고 0개의 파일을 삭제
  1. +1
    -0
      slstatus.c

+ 1
- 0
slstatus.c 파일 보기

@@ -98,6 +98,7 @@ main(int argc, char *argv[])

if (sflag) {
printf("%s\n", status);
fflush(stdout);
} else {
XStoreName(dpy, DefaultRootWindow(dpy), status);
XSync(dpy, False);


불러오는 중...
취소
저장