浏览代码

I vow to rerun _all_ the tests before making commits. :-(
I successfully managed to blow away all the modeflags for the file
_except_ the one dealing with buffering...

Manuel Novoa III 23 年之前
父节点
当前提交
f654c6f7b8
共有 1 个文件被更改,包括 2 次插入2 次删除
  1. 2 2
      libc/stdio/stdio.c

+ 2 - 2
libc/stdio/stdio.c

@@ -1773,8 +1773,8 @@ void _stdio_init(void)
 {
 #ifdef __STDIO_BUFFERS
 	/* stdin and stdout uses line buffering when connected to a tty. */
-	_stdio_streams[0].modeflags &= isatty(0) * __FLAG_LBF;
-	_stdio_streams[1].modeflags &= isatty(1) * __FLAG_LBF;
+	_stdio_streams[0].modeflags ^= (1-isatty(0)) * __FLAG_LBF;
+	_stdio_streams[1].modeflags ^= (1-isatty(1)) * __FLAG_LBF;
 #endif /* __STDIO_BUFFERS */
 #ifndef __UCLIBC__
 /* __stdio_term is automatically when exiting if stdio is used.