Am 07.02.16 um 21:21 schrieb Leonardo: > Hi. I've made some mistakes on my previous message. I should have been > more patient. After further investigation, I realized that ETIMEDOUT > is defined in several header files: > > #define ETIMEDOUT WSAETIMEDOUT - WinSock2.h > #define ETIMEDOUT 138 - winsock.h > #define ETIMEDOUT WSAETIMEDOUT - winerror.h > > WSAETIMEDOUT has the right value: > > #define WSAETIMEDOUT (WSABASEERR+60) - WinSock2.h > #define WSAETIMEDOUT (WSABASEERR+60) - winsock.h > #define WSAETIMEDOUT 10060L - winerror.h > > So it seems like socket.c is getting its value from winsock.h. Here's > a better patch: > > Signed-off-by: Leonardo Basilio <leobasi...@gmail.com> > --- > src/openvpn/socket.c | 4 ++++ > 1 file changed, 4 insertions(+) > > diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c > index 396fa54..37fa129 100644 > --- a/src/openvpn/socket.c > +++ b/src/openvpn/socket.c > @@ -1177,7 +1177,11 @@ openvpn_connect (socket_descriptor_t sd, > { > if (--connect_timeout < 0) > { > +#ifdef WIN32 > + status = WSAETIMEDOUT; > +#else > status = ETIMEDOUT; > +#endif > break; > } > openvpn_sleep (1); I give a cautionary ACK to this. I have not tested this but the code looks good and the explaination sounds valid.
Arne