summaryrefslogtreecommitdiffstats
path: root/lib/libc/stdio/freopen.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libc/stdio/freopen.c')
-rw-r--r--lib/libc/stdio/freopen.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/libc/stdio/freopen.c b/lib/libc/stdio/freopen.c
index 4dcd50f..8b68bac 100644
--- a/lib/libc/stdio/freopen.c
+++ b/lib/libc/stdio/freopen.c
@@ -240,8 +240,11 @@ finish:
* we can do about this. (We could set __SAPP and check in
* fseek and ftell.)
*/
- if (oflags & O_APPEND)
+ if (oflags & O_APPEND) {
+ /* XXX: Reuse __SALC for O_APPEND. */
+ fp->_flags |= __SALC;
(void) _sseek(fp, (fpos_t)0, SEEK_END);
+ }
FUNLOCKFILE(fp);
return (fp);
}
OpenPOWER on IntegriCloud