diff options
Diffstat (limited to 'lib/libc/stdio/fdopen.c')
-rw-r--r-- | lib/libc/stdio/fdopen.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/libc/stdio/fdopen.c b/lib/libc/stdio/fdopen.c index 2e19b9f..e5d167a 100644 --- a/lib/libc/stdio/fdopen.c +++ b/lib/libc/stdio/fdopen.c @@ -90,7 +90,9 @@ fdopen(int fd, const char *mode) * O_APPEND bit set, assert __SAPP so that __swrite() caller * will _sseek() to the end before write. */ - if ((oflags & O_APPEND) && !(fdflags & O_APPEND)) + if (fdflags & O_APPEND) + fp->_flags2 |= __S2OAP; + else if (oflags & O_APPEND) fp->_flags |= __SAPP; fp->_file = fd; fp->_cookie = fp; |