From c2174976ff95f10cda3238e8f4d144ff46605b92 Mon Sep 17 00:00:00 2001 From: Ted Unangst Date: Sat, 17 Oct 2015 00:38:58 +0000 Subject: don't need fcntl for non blocking socket, just ask for it upfront --- usr.sbin/rebound/rebound.c | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'usr.sbin') diff --git a/usr.sbin/rebound/rebound.c b/usr.sbin/rebound/rebound.c index 740cbe7f153..2ca65daa6ab 100644 --- a/usr.sbin/rebound/rebound.c +++ b/usr.sbin/rebound/rebound.c @@ -1,4 +1,4 @@ -/* $OpenBSD: rebound.c,v 1.25 2015/10/16 20:25:09 tedu Exp $ */ +/* $OpenBSD: rebound.c,v 1.26 2015/10/17 00:38:57 tedu Exp $ */ /* * Copyright (c) 2015 Ted Unangst * @@ -24,7 +24,6 @@ #include #include -#include #include #include #include @@ -308,11 +307,9 @@ newtcprequest(int ld, struct sockaddr *remoteaddr) if (req->client == -1) goto fail; - req->s = socket(remoteaddr->sa_family, SOCK_STREAM, 0); + req->s = socket(remoteaddr->sa_family, SOCK_STREAM | SOCK_NONBLOCK, 0); if (req->s == -1) goto fail; - if (fcntl(req->s, F_SETFL, O_NONBLOCK) == -1) - goto fail; req->phase = 1; if (connect(req->s, remoteaddr, remoteaddr->sa_len) == -1) { if (errno != EINPROGRESS) -- cgit v1.2.3