summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorjeremy <jeremy@openbsd.org>2011-01-08 00:47:19 +0000
committerjeremy <jeremy@openbsd.org>2011-01-08 00:47:19 +0000
commit81dc5f33c0fc26c512e278cd7f5c794cf9128ff1 (patch)
tree7b08c61ca573024b532bb9d39ab683c5ac1fe1f8
parentSupport unix domain sockets in nc(1) with -Uu. (diff)
downloadwireguard-openbsd-81dc5f33c0fc26c512e278cd7f5c794cf9128ff1.tar.xz
wireguard-openbsd-81dc5f33c0fc26c512e278cd7f5c794cf9128ff1.zip
Enable unix datagram support by treating ENOBUFS like EAGAIN.
Separate commit requested by deraadt@. OK nicm@
-rw-r--r--usr.bin/nc/atomicio.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/usr.bin/nc/atomicio.c b/usr.bin/nc/atomicio.c
index e9d98b3561e..feb6f194409 100644
--- a/usr.bin/nc/atomicio.c
+++ b/usr.bin/nc/atomicio.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: atomicio.c,v 1.9 2007/09/07 14:50:44 tobias Exp $ */
+/* $OpenBSD: atomicio.c,v 1.10 2011/01/08 00:47:19 jeremy Exp $ */
/*
* Copyright (c) 2006 Damien Miller. All rights reserved.
* Copyright (c) 2005 Anil Madhavapeddy. All rights reserved.
@@ -53,7 +53,7 @@ atomicio(ssize_t (*f) (int, void *, size_t), int fd, void *_s, size_t n)
case -1:
if (errno == EINTR)
continue;
- if (errno == EAGAIN) {
+ if ((errno == EAGAIN) || (errno == ENOBUFS)) {
(void)poll(&pfd, 1, -1);
continue;
}