const union sockaddr_union *sa;
int err = 0;
short localport;
- int fl, salen, family;
+ int salen, family;
/*
* Remove the socket from the tree before we overwrite its
exit(1); /* XXX: GCC doesn't understand assert() on some systems. */
}
- fl = fcntl(s, F_GETFL);
- if (fl != -1)
- fcntl(s, F_SETFL, fl | O_NONBLOCK);
+ nonblock(s);
if ((connect(s, &(sa->sa), salen)) < 0) {
if ( errno != EINPROGRESS ) {
union sockaddr_union su;
socklen_t addrlen = sizeof(su);
int t; /* socket of connection */
- int fl;
memset(&su, 0, addrlen);
t = accept(s->s, &su.sa, &addrlen);
break;
}
- fl = fcntl(t, F_GETFL);
- if (fl != -1)
- fcntl(t, F_SETFL, fl | O_NONBLOCK);
+ nonblock(t);
if (s->localhost_only &&
!sockaddr_is_loopback(&su.sa)) {