aboutsummaryrefslogtreecommitdiff
path: root/lib/libpthread/thread/thr_readv.c
diff options
context:
space:
mode:
authorDaniel Eischen <deischen@FreeBSD.org>2002-08-29 23:06:07 +0000
committerDaniel Eischen <deischen@FreeBSD.org>2002-08-29 23:06:07 +0000
commitd8b5986dd6a718d948b9ea0e2da3256ac45bff42 (patch)
tree24c4da9130c487d85f113d7fdfa44a22f470cb61 /lib/libpthread/thread/thr_readv.c
parentee92a1ab51e1543706ad3802c5d218b04df5e0ba (diff)
downloadsrc-d8b5986dd6a718d948b9ea0e2da3256ac45bff42.tar.gz
src-d8b5986dd6a718d948b9ea0e2da3256ac45bff42.zip
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
Notes
Notes: svn path=/head/; revision=102590
Diffstat (limited to 'lib/libpthread/thread/thr_readv.c')
-rw-r--r--lib/libpthread/thread/thr_readv.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libpthread/thread/thr_readv.c b/lib/libpthread/thread/thr_readv.c
index 0aa6c15820c5..e2b79d73696c 100644
--- a/lib/libpthread/thread/thr_readv.c
+++ b/lib/libpthread/thread/thr_readv.c
@@ -52,7 +52,7 @@ _readv(int fd, const struct iovec * iov, int iovcnt)
/* Lock the file descriptor for read: */
if ((ret = _FD_LOCK(fd, FD_READ, NULL)) == 0) {
/* Get the read/write mode type: */
- type = _thread_fd_table[fd]->flags & O_ACCMODE;
+ type = _thread_fd_getflags(fd) & O_ACCMODE;
/* Check if the file is not open for read: */
if (type != O_RDONLY && type != O_RDWR) {
@@ -64,7 +64,7 @@ _readv(int fd, const struct iovec * iov, int iovcnt)
/* Perform a non-blocking readv syscall: */
while ((ret = __sys_readv(fd, iov, iovcnt)) < 0) {
- if ((_thread_fd_table[fd]->flags & O_NONBLOCK) == 0 &&
+ if ((_thread_fd_getflags(fd) & O_NONBLOCK) == 0 &&
(errno == EWOULDBLOCK || errno == EAGAIN)) {
curthread->data.fd.fd = fd;
_thread_kern_set_timeout(NULL);