summaryrefslogtreecommitdiffstats
path: root/lib/libc_r/uthread/uthread_recvfrom.c
diff options
context:
space:
mode:
authordeischen <deischen@FreeBSD.org>2002-08-29 23:06:07 +0000
committerdeischen <deischen@FreeBSD.org>2002-08-29 23:06:07 +0000
commit8347fcb52dac051382b95182fce08ee0fc642340 (patch)
tree24c4da9130c487d85f113d7fdfa44a22f470cb61 /lib/libc_r/uthread/uthread_recvfrom.c
parent175524795910e8310c89ecf8adfddb91fc451e9e (diff)
downloadFreeBSD-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/libc_r/uthread/uthread_recvfrom.c')
-rw-r--r--lib/libc_r/uthread/uthread_recvfrom.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/libc_r/uthread/uthread_recvfrom.c b/lib/libc_r/uthread/uthread_recvfrom.c
index 0643126..d6f8da1 100644
--- a/lib/libc_r/uthread/uthread_recvfrom.c
+++ b/lib/libc_r/uthread/uthread_recvfrom.c
@@ -49,7 +49,8 @@ _recvfrom(int fd, void *buf, size_t len, int flags, struct sockaddr * from,
if ((ret = _FD_LOCK(fd, FD_READ, NULL)) == 0) {
while ((ret = __sys_recvfrom(fd, buf, len, flags, from, from_len)) < 0) {
- if (!(_thread_fd_table[fd]->flags & O_NONBLOCK) && ((errno == EWOULDBLOCK) || (errno == EAGAIN))) {
+ if (((_thread_fd_getflags(fd) & O_NONBLOCK) == 0)
+ && ((errno == EWOULDBLOCK) || (errno == EAGAIN))) {
curthread->data.fd.fd = fd;
/* Set the timeout: */
OpenPOWER on IntegriCloud