diff options
author | Denis Vlasenko <vda.linux@googlemail.com> | 2009-02-15 05:46:11 +0000 |
---|---|---|
committer | Denis Vlasenko <vda.linux@googlemail.com> | 2009-02-15 05:46:11 +0000 |
commit | 5b07c52a06e9419fadb75bd153f4b4cfc1f6631d (patch) | |
tree | 19c95ab5e4c777fc2e33f6bd0e5a2cf6eebb6c2c /libc/stdio/fdopen.c | |
parent | ed0abe10a7d8e3997f5894199e4195833e7f8312 (diff) | |
download | uClibc-alpine-5b07c52a06e9419fadb75bd153f4b4cfc1f6631d.tar.bz2 uClibc-alpine-5b07c52a06e9419fadb75bd153f4b4cfc1f6631d.tar.xz |
suppress bogus ioctl on fd==INT_MAX when vasprintf() is called
Diffstat (limited to 'libc/stdio/fdopen.c')
-rw-r--r-- | libc/stdio/fdopen.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/libc/stdio/fdopen.c b/libc/stdio/fdopen.c index d47d6ea99..85ece2a5f 100644 --- a/libc/stdio/fdopen.c +++ b/libc/stdio/fdopen.c @@ -14,8 +14,9 @@ FILE *fdopen(int filedes, const char *mode) { intptr_t cur_mode; - return (((cur_mode = fcntl(filedes, F_GETFL))) != -1) - ? _stdio_fopen(cur_mode, mode, NULL, filedes) - : NULL; + cur_mode = fcntl(filedes, F_GETFL); + if (cur_mode != -1) + return _stdio_fopen(cur_mode, mode, NULL, filedes); + return NULL; } libc_hidden_def(fdopen) |