summaryrefslogtreecommitdiffstats
path: root/c/src/lib/libc/fcntl.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>1999-11-02 16:27:53 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>1999-11-02 16:27:53 +0000
commit5f2566b5e2d3d5a926562ec33e1901ba7e1470f3 (patch)
tree90e93cf614dfdc3c7c4d940b0dabe35187801836 /c/src/lib/libc/fcntl.c
parentAdded support for configuring base filesystem. First attempt at (diff)
downloadrtems-5f2566b5e2d3d5a926562ec33e1901ba7e1470f3.tar.bz2
Fixed F_SETFL to properly convert between internal
libio flags and external fcntl.h style flags.
Diffstat (limited to '')
-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 5ed66ede5d..e75baf0c5a 100644
--- a/c/src/lib/libc/fcntl.c
+++ b/c/src/lib/libc/fcntl.c
@@ -30,6 +30,7 @@ int fcntl(
rtems_libio_t *diop;
int fd2;
int flags;
+ int mask;
int ret = 0;
va_start( ap, cmd );
@@ -92,13 +93,13 @@ int fcntl(
case F_SETFL:
flags = rtems_libio_fcntl_flags( va_arg( ap, int ) );
+ mask = LIBIO_FLAGS_NO_DELAY | LIBIO_FLAGS_APPEND;
/*
* XXX If we are turning on append, should we seek to the end?
*/
- iop->flags = (iop->flags & ~(O_APPEND | O_NONBLOCK)) |
- (flags & (O_APPEND | O_NONBLOCK));
+ iop->flags = (iop->flags & ~mask) | (flags & mask);
break;
case F_GETLK: