X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/792c5eb59e86c1ec50e85b8bf2aee813adb763b7..4b70e70e68842c1a9c23cf357312f7256b20310a:/unix/uxnet.c diff --git a/unix/uxnet.c b/unix/uxnet.c index f4731fd0..8ae0c2f6 100644 --- a/unix/uxnet.c +++ b/unix/uxnet.c @@ -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