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/freopen.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/freopen.c')
-rw-r--r-- | lib/libc/stdio/freopen.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libc/stdio/freopen.c b/lib/libc/stdio/freopen.c index 8b68bac..e0104c8 100644 --- a/lib/libc/stdio/freopen.c +++ b/lib/libc/stdio/freopen.c @@ -187,6 +187,7 @@ finish: fp->_lb._size = 0; fp->_orientation = 0; memset(&fp->_mbstate, 0, sizeof(mbstate_t)); + fp->_flags2 = 0; if (f < 0) { /* did not get it after all */ if (isopen) @@ -241,8 +242,7 @@ finish: * fseek and ftell.) */ if (oflags & O_APPEND) { - /* XXX: Reuse __SALC for O_APPEND. */ - fp->_flags |= __SALC; + fp->_flags2 |= __S2OAP; (void) _sseek(fp, (fpos_t)0, SEEK_END); } FUNLOCKFILE(fp); |