diff options
author | ache <ache@FreeBSD.org> | 2015-10-28 14:40:02 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 2015-10-28 14:40:02 +0000 |
commit | 64dac23af83b727e5f33d41dc5ecb1444c8c0c30 (patch) | |
tree | baa8aba8f21fff38237715019c7a521ac1e39e6a /lib/libc/stdio/stdio.c | |
parent | c641ee406283e8610464caba08dac1b0ffd2cfff (diff) | |
download | FreeBSD-src-64dac23af83b727e5f33d41dc5ecb1444c8c0c30.zip FreeBSD-src-64dac23af83b727e5f33d41dc5ecb1444c8c0c30.tar.gz |
Add _flags2 per jhb@ suggestion since no room left in _flags.
Rewrite O_APPEND flag checking using new __S2OAP flag.
MFC after: 3 weeks
Diffstat (limited to 'lib/libc/stdio/stdio.c')
-rw-r--r-- | lib/libc/stdio/stdio.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/lib/libc/stdio/stdio.c b/lib/libc/stdio/stdio.c index fc2e74b..5d6fb9a 100644 --- a/lib/libc/stdio/stdio.c +++ b/lib/libc/stdio/stdio.c @@ -117,8 +117,7 @@ _swrite(FILE *fp, char const *buf, int n) ret = (*fp->_write)(fp->_cookie, buf, n); /* __SOFF removed even on success in case O_APPEND mode is set. */ if (ret >= 0) { - /* XXX: Reuse __SALC for O_APPEND. */ - if ((fp->_flags & __SOFF) && !(fp->_flags & __SALC) && + if ((fp->_flags & __SOFF) && !(fp->_flags2 & __S2OAP) && fp->_offset <= OFF_MAX - ret) fp->_offset += ret; else |