summaryrefslogtreecommitdiff
path: root/libc/stdio/_stdio.c
diff options
context:
space:
mode:
authorDenis Vlasenko <vda.linux@googlemail.com>2009-02-15 05:45:24 +0000
committerDenis Vlasenko <vda.linux@googlemail.com>2009-02-15 05:45:24 +0000
commit3c71e47750ea70d3dfa46490b28740eccf711956 (patch)
tree9ab93c745fb98ff2fa87bae1abcdb1e908ee04b4 /libc/stdio/_stdio.c
parent44d44d807ede85c53e05d88df82036b23c23e4a9 (diff)
suppress bogus ioctl on fd==INT_MAX when vasprintf() is called
Diffstat (limited to 'libc/stdio/_stdio.c')
-rw-r--r--libc/stdio/_stdio.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/libc/stdio/_stdio.c b/libc/stdio/_stdio.c
index 52e7295cf..3c3ce59c7 100644
--- a/libc/stdio/_stdio.c
+++ b/libc/stdio/_stdio.c
@@ -253,8 +253,10 @@ void attribute_hidden _stdio_init(void)
#ifdef __STDIO_BUFFERS
int old_errno = errno;
/* stdin and stdout uses line buffering when connected to a tty. */
- _stdio_streams[0].__modeflags ^= (1-isatty(0)) * __FLAG_LBF;
- _stdio_streams[1].__modeflags ^= (1-isatty(1)) * __FLAG_LBF;
+ if (!isatty(0))
+ _stdio_streams[0].__modeflags ^= __FLAG_LBF;
+ if (!isatty(1))
+ _stdio_streams[1].__modeflags ^= __FLAG_LBF;
__set_errno(old_errno);
#endif
#ifndef __UCLIBC__