summaryrefslogtreecommitdiffstats
path: root/usr.sbin/amd
diff options
context:
space:
mode:
authorguenther <guenther@openbsd.org>2015-09-13 15:44:47 +0000
committerguenther <guenther@openbsd.org>2015-09-13 15:44:47 +0000
commit4f68b03b406b747e5b0f54e50f473263f5c5e6d7 (patch)
tree7641e73d321d4011df7beca3fc5032bb8731c04e /usr.sbin/amd
parentDescribe tar's -p option correctly (diff)
downloadwireguard-openbsd-4f68b03b406b747e5b0f54e50f473263f5c5e6d7.tar.xz
wireguard-openbsd-4f68b03b406b747e5b0f54e50f473263f5c5e6d7.zip
More FNDELAY/FIONBIO --> SOCK_NONBLOCK conversions
ok millert@
Diffstat (limited to 'usr.sbin/amd')
-rw-r--r--usr.sbin/amd/amd/rpc_fwd.c18
1 files changed, 2 insertions, 16 deletions
diff --git a/usr.sbin/amd/amd/rpc_fwd.c b/usr.sbin/amd/amd/rpc_fwd.c
index 2cc341c2cb2..442912b1d36 100644
--- a/usr.sbin/amd/amd/rpc_fwd.c
+++ b/usr.sbin/amd/amd/rpc_fwd.c
@@ -32,7 +32,7 @@
* SUCH DAMAGE.
*
* from: @(#)rpc_fwd.c 8.1 (Berkeley) 6/6/93
- * $Id: rpc_fwd.c,v 1.9 2014/10/26 03:28:41 guenther Exp $
+ * $Id: rpc_fwd.c,v 1.10 2015/09/13 15:44:47 guenther Exp $
*/
/*
@@ -41,12 +41,6 @@
#include "am.h"
#include <sys/ioctl.h>
-#ifndef F_SETFL
-#include <fcntl.h>
-#endif /* F_SETFL */
-#ifndef FNDELAY
-#include <sys/file.h>
-#endif /* FNDELAY */
/*
* Note that the ID field in the external packet is only
@@ -164,12 +158,10 @@ fwd_free(rpc_forward *p)
*/
int fwd_init()
{
- int on = 1;
-
/*
* Create ping socket
*/
- fwd_sock = socket(AF_INET, SOCK_DGRAM, 0);
+ fwd_sock = socket(AF_INET, SOCK_DGRAM | SOCK_NONBLOCK, 0);
if (fwd_sock < 0) {
plog(XLOG_ERROR, "Unable to create RPC forwarding socket: %m");
return errno;
@@ -181,12 +173,6 @@ int fwd_init()
if (bind_resv_port(fwd_sock, (unsigned short *) 0) < 0)
plog(XLOG_ERROR, "can't bind privileged port");
- if (fcntl(fwd_sock, F_SETFL, FNDELAY) < 0 &&
- ioctl(fwd_sock, FIONBIO, &on) < 0) {
- plog(XLOG_ERROR, "Can't set non-block on forwarding socket: %m");
- return errno;
- }
-
return 0;
}