X-Git-Url: https://git.distorted.org.uk/~mdw/secnet/blobdiff_plain/5e7a5e2d42c1b06f249debca72c10ad33d157402..a0fac2f1c903f765c8b8596f1ec93beb52b72c7a:/udp.c diff --git a/udp.c b/udp.c index 8947058..5ad0fd4 100644 --- a/udp.c +++ b/udp.c @@ -206,8 +206,7 @@ bool_t udp_make_socket(struct udpcommon *uc, struct udpsock *us, us->fd=socket(addr->sa.sa_family, SOCK_DGRAM, IPPROTO_UDP); if (us->fd<0) FAIL("socket"); - if (fcntl(us->fd, F_SETFL, fcntl(us->fd, F_GETFL)|O_NONBLOCK)==-1) - FAIL("fcntl(set O_NONBLOCK)"); + setnonblock(us->fd); setcloexec(us->fd); #ifdef CONFIG_IPV6 if (addr->sa.sa_family==AF_INET6) {