protect_fd_nonlocal(sd, remote);
#endif
-#ifdef CONNECT_NONBLOCK
set_nonblock(sd);
status = connect(sd, remote, af_addr_size(remote->sa_family));
if (status)
}
}
}
-#else /* ifdef CONNECT_NONBLOCK */
- status = connect(sd, remote, af_addr_size(remote->sa_family));
- if (status)
- {
- status = openvpn_errno();
- }
-#endif /* ifdef CONNECT_NONBLOCK */
return status;
}
struct gc_arena gc = gc_new();
int status;
-#ifdef CONNECT_NONBLOCK
- msg(M_INFO, "Attempting to establish TCP connection with %s [nonblock]",
- print_sockaddr(dest, &gc));
-#else
msg(M_INFO, "Attempting to establish TCP connection with %s",
print_sockaddr(dest, &gc));
-#endif
#ifdef ENABLE_MANAGEMENT
if (management)
#define EPOLL 0
#endif
-/*
- * Is non-blocking connect() supported?
- */
-#if defined(SOL_SOCKET) && defined(SO_ERROR) && defined(EINPROGRESS) && defined(ETIMEDOUT)
-#define CONNECT_NONBLOCK
-#endif
-
/*
* Compression support
*/