diff options
author | deischen <deischen@FreeBSD.org> | 2002-08-29 23:06:07 +0000 |
---|---|---|
committer | deischen <deischen@FreeBSD.org> | 2002-08-29 23:06:07 +0000 |
commit | 8347fcb52dac051382b95182fce08ee0fc642340 (patch) | |
tree | 24c4da9130c487d85f113d7fdfa44a22f470cb61 /lib/libkse/thread/thr_fcntl.c | |
parent | 175524795910e8310c89ecf8adfddb91fc451e9e (diff) | |
download | FreeBSD-src-8347fcb52dac051382b95182fce08ee0fc642340.zip FreeBSD-src-8347fcb52dac051382b95182fce08ee0fc642340.tar.gz |
Remove much of the dereferencing of the fd table entries to look
at file flags and replace it with functions that will avoid null
pointer checks.
MFC to be done by archie ;-)
PR: 42100
Reviewed by: archie, robert
MFC after: 3 days
Diffstat (limited to 'lib/libkse/thread/thr_fcntl.c')
-rw-r--r-- | lib/libkse/thread/thr_fcntl.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/lib/libkse/thread/thr_fcntl.c b/lib/libkse/thread/thr_fcntl.c index 1d12c0e..a5b6405 100644 --- a/lib/libkse/thread/thr_fcntl.c +++ b/lib/libkse/thread/thr_fcntl.c @@ -76,9 +76,10 @@ _fcntl(int fd, int cmd,...) } else { /* * Save the file open flags so that they can - * be checked later: + * be checked later: */ - _thread_fd_table[ret]->flags = _thread_fd_table[fd]->flags; + _thread_fd_setflags(ret, + _thread_fd_getflags(fd)); } break; case F_SETFD: @@ -89,7 +90,7 @@ _fcntl(int fd, int cmd,...) ret = __sys_fcntl(fd, cmd, 0); break; case F_GETFL: - ret = _thread_fd_table[fd]->flags; + ret = _thread_fd_getflags(fd); break; case F_SETFL: /* @@ -119,10 +120,10 @@ _fcntl(int fd, int cmd,...) */ } else if (nonblock) /* A non-blocking descriptor: */ - _thread_fd_table[fd]->flags = flags | O_NONBLOCK; + _thread_fd_setflags(fd, flags | O_NONBLOCK); else /* Save the flags: */ - _thread_fd_table[fd]->flags = flags & ~O_NONBLOCK; + _thread_fd_setflags(fd, flags & ~O_NONBLOCK); break; default: /* Might want to make va_arg use a union */ |