summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libc/fcntl.c
diff options
context:
space:
mode:
Diffstat (limited to 'c/src/lib/libc/fcntl.c')
-rw-r--r--c/src/lib/libc/fcntl.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/c/src/lib/libc/fcntl.c b/c/src/lib/libc/fcntl.c
index 9359575e51..381df45f26 100644
--- a/c/src/lib/libc/fcntl.c
+++ b/c/src/lib/libc/fcntl.c
@@ -95,13 +95,14 @@ int fcntl(
* XXX man page, only these flags can be added.
*/
- flags &= ~(O_APPEND | O_NONBLOCK);
+ flags = (iop->flags & ~(O_APPEND|O_NONBLOCK)) |
+ (flags & (O_APPEND|O_NONBLOCK));
/*
* XXX If we are turning on append, should we seek to the end?
*/
- iop->flags |= flags;
+ iop->flags = flags;
return 0;
case F_GETLK: