summaryrefslogtreecommitdiff
path: root/usr.sbin/ypbind/ypbind.c
diff options
context:
space:
mode:
Diffstat (limited to 'usr.sbin/ypbind/ypbind.c')
-rw-r--r--usr.sbin/ypbind/ypbind.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/usr.sbin/ypbind/ypbind.c b/usr.sbin/ypbind/ypbind.c
index e4b78df3d00..9c4aef0e470 100644
--- a/usr.sbin/ypbind/ypbind.c
+++ b/usr.sbin/ypbind/ypbind.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ypbind.c,v 1.65 2015/12/12 20:04:23 mmcc Exp $ */
+/* $OpenBSD: ypbind.c,v 1.66 2016/03/21 00:49:36 guenther Exp $ */
/*
* Copyright (c) 1992, 1993, 1996, 1997, 1998 Theo de Raadt <deraadt@openbsd.org>
@@ -475,7 +475,7 @@ main(int argc, char *argv[])
}
}
- if ((rpcsock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
+ if ((rpcsock = socket(AF_INET, SOCK_DGRAM | SOCK_NONBLOCK, 0)) < 0) {
perror("socket");
return -1;
}
@@ -485,7 +485,7 @@ main(int argc, char *argv[])
sin.sin_port = 0;
bindresvport(rpcsock, &sin);
- if ((pingsock = socket(AF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0) {
+ if ((pingsock = socket(AF_INET, SOCK_DGRAM | SOCK_NONBLOCK, 0)) < 0) {
perror("socket");
return -1;
}
@@ -495,8 +495,6 @@ main(int argc, char *argv[])
sin.sin_port = 0;
bindresvport(pingsock, &sin);
- fcntl(rpcsock, F_SETFL, fcntl(rpcsock, F_GETFL, 0) | FNDELAY);
- fcntl(pingsock, F_SETFL, fcntl(pingsock, F_GETFL, 0) | FNDELAY);
setsockopt(rpcsock, SOL_SOCKET, SO_BROADCAST, &one,
(socklen_t)sizeof(one));
rmtca.prog = YPPROG;