mirror of
https://git.tartarus.org/simon/putty.git
synced 2025-01-25 01:02: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;
|
||||
Actual_Socket ret;
|
||||
short localport;
|
||||
int fl;
|
||||
|
||||
/*
|
||||
* 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_port = htons((short) port);
|
||||
#endif
|
||||
{
|
||||
int i = 1;
|
||||
ioctl(s, FIONBIO, &i);
|
||||
}
|
||||
|
||||
fl = fcntl(s, F_GETFL);
|
||||
if (fl != -1)
|
||||
fcntl(s, F_SETFL, fl | O_NONBLOCK);
|
||||
|
||||
if ((
|
||||
#ifdef IPV6
|
||||
|
Loading…
Reference in New Issue
Block a user