summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjakemsr <jakemsr@openbsd.org>2009-04-11 20:26:58 +0000
committerjakemsr <jakemsr@openbsd.org>2009-04-11 20:26:58 +0000
commitec28fd36c50604868492e203be5b1d4767ae8d88 (patch)
tree4da8233ea009463f17cde2c56d317f373d5a0486
parentin the old days compiler could not convert decimal constants (diff)
downloadwireguard-openbsd-ec28fd36c50604868492e203be5b1d4767ae8d88.tar.xz
wireguard-openbsd-ec28fd36c50604868492e203be5b1d4767ae8d88.zip
honor MSG_DONTWAIT
ok marc@, guenther@
-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;