summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorJacob Meuser <jakemsr@cvs.openbsd.org>2009-04-11 20:26:59 +0000
committerJacob Meuser <jakemsr@cvs.openbsd.org>2009-04-11 20:26:59 +0000
commit6661dea778370c02b850ce72f28556319aca2143 (patch)
tree40d3cf2a331776c102ea27e18522607fe282823b /lib
parent3006c130095f6097759a775ce732636429614162 (diff)
honor MSG_DONTWAIT
ok marc@, guenther@
Diffstat (limited to 'lib')
-rw-r--r--lib/libpthread/uthread/uthread_recvfrom.c3
-rw-r--r--lib/libpthread/uthread/uthread_recvmsg.c3
2 files changed, 4 insertions, 2 deletions
diff --git a/lib/libpthread/uthread/uthread_recvfrom.c b/lib/libpthread/uthread/uthread_recvfrom.c
index f27e6e2397a..a76873fdf14 100644
--- a/lib/libpthread/uthread/uthread_recvfrom.c
+++ b/lib/libpthread/uthread/uthread_recvfrom.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_recvfrom.c,v 1.9 2007/05/01 18:16:38 kurt Exp $ */
+/* $OpenBSD: uthread_recvfrom.c,v 1.10 2009/04/11 20:26:58 jakemsr Exp $ */
/*
* Copyright (c) 1995-1998 John Birrell <jb@cimlogic.com.au>
* All rights reserved.
@@ -52,6 +52,7 @@ recvfrom(int fd, void *buf, size_t len, int flags, struct sockaddr * from, sockl
if ((ret = _FD_LOCK(fd, FD_READ, NULL)) == 0) {
while ((ret = _thread_sys_recvfrom(fd, buf, len, flags, from, from_len)) < 0) {
if (!(_thread_fd_table[fd]->status_flags->flags & O_NONBLOCK) &&
+ !(flags & MSG_DONTWAIT) &&
((errno == EWOULDBLOCK) || (errno == EAGAIN))) {
curthread->data.fd.fd = fd;
diff --git a/lib/libpthread/uthread/uthread_recvmsg.c b/lib/libpthread/uthread/uthread_recvmsg.c
index 2bde8ee06d9..4e14aad4549 100644
--- a/lib/libpthread/uthread/uthread_recvmsg.c
+++ b/lib/libpthread/uthread/uthread_recvmsg.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uthread_recvmsg.c,v 1.8 2007/05/01 18:16:38 kurt Exp $ */
+/* $OpenBSD: uthread_recvmsg.c,v 1.9 2009/04/11 20:26:58 jakemsr Exp $ */
/*
* Copyright (c) 1998 John Birrell <jb@cimlogic.com.au>
* All rights reserved.
@@ -52,6 +52,7 @@ recvmsg(int fd, struct msghdr *msg, int flags)
if ((ret = _FD_LOCK(fd, FD_READ, NULL)) == 0) {
while ((ret = _thread_sys_recvmsg(fd, msg, flags)) < 0) {
if (!(_thread_fd_table[fd]->status_flags->flags & O_NONBLOCK) &&
+ !(flags & MSG_DONTWAIT) &&
((errno == EWOULDBLOCK) || (errno == EAGAIN))) {
curthread->data.fd.fd = fd;