mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-27 18:22:24 +00:00
Replace use of FIONBIO with POSIX-approved O_NONBLOCK (set using fcntl()).
This should save us having to worry about different OSs' defining it in different headers. [originally from svn r3126]
This commit is contained in:
parent
e7c7f5e3f8
commit
d66a1d685f
@ -383,6 +383,7 @@ Socket sk_new(SockAddr addr, int port, int privport, int oobinline,
|
|||||||
int err;
|
int err;
|
||||||
Actual_Socket ret;
|
Actual_Socket ret;
|
||||||
short localport;
|
short localport;
|
||||||
|
int fl;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Create Socket structure.
|
* Create Socket structure.
|
||||||
@ -492,10 +493,10 @@ Socket sk_new(SockAddr addr, int port, int privport, int oobinline,
|
|||||||
a.sin_addr.s_addr = htonl(addr->address);
|
a.sin_addr.s_addr = htonl(addr->address);
|
||||||
a.sin_port = htons((short) port);
|
a.sin_port = htons((short) port);
|
||||||
#endif
|
#endif
|
||||||
{
|
|
||||||
int i = 1;
|
fl = fcntl(s, F_GETFL);
|
||||||
ioctl(s, FIONBIO, &i);
|
if (fl != -1)
|
||||||
}
|
fcntl(s, F_SETFL, fl | O_NONBLOCK);
|
||||||
|
|
||||||
if ((
|
if ((
|
||||||
#ifdef IPV6
|
#ifdef IPV6
|
||||||
|
Loading…
Reference in New Issue
Block a user