mirror of
https://github.com/rkd77/elinks.git
synced 2024-12-04 14:46:47 -05:00
[socket] Do not do exceptions in code for Win32
One set_nonblocking_fd
This commit is contained in:
parent
154479e849
commit
2624d22b6e
@ -350,14 +350,8 @@ sock_error:
|
|||||||
|
|
||||||
/* Set it non-blocking */
|
/* Set it non-blocking */
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
if (set_nonblocking_fd(sock) < 0)
|
if (set_nonblocking_fd(sock) < 0)
|
||||||
goto sock_error;
|
goto sock_error;
|
||||||
#else
|
|
||||||
u_long mode = 1;
|
|
||||||
ioctlsocket(sock, FIONBIO, &mode);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
/* Bind it to some port */
|
/* Bind it to some port */
|
||||||
|
|
||||||
@ -666,16 +660,11 @@ connect_socket(struct socket *csocket, struct connection_state state)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
#ifndef WIN32
|
|
||||||
if (set_nonblocking_fd(sock) < 0) {
|
if (set_nonblocking_fd(sock) < 0) {
|
||||||
if (errno && !saved_errno) saved_errno = errno;
|
if (errno && !saved_errno) saved_errno = errno;
|
||||||
close(sock);
|
close(sock);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
#else
|
|
||||||
u_long mode = 1;
|
|
||||||
ioctlsocket(sock, FIONBIO, &mode);
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifdef HAVE_INET_PTON
|
#ifdef HAVE_INET_PTON
|
||||||
if (pf == PF_INET && to_bind) {
|
if (pf == PF_INET && to_bind) {
|
||||||
|
Loading…
Reference in New Issue
Block a user