diff options
author | Alberto Gonzalez Iniesta <agi@inittab.org> | 2015-06-30 08:22:29 +0200 |
---|---|---|
committer | Alberto Gonzalez Iniesta <agi@inittab.org> | 2015-06-30 08:22:29 +0200 |
commit | 6149d88c5a2c58a9cc943ca02c36e8ee4e5d1751 (patch) | |
tree | 0fdc36dba5e216faf7ade9d7b327090b4a20bd2b /src/openvpn/socket.c | |
parent | 63862ed15e1abb4b29c5a43b469321c928613c62 (diff) |
Imported Upstream version 2.3.7upstream/2.3.7
Diffstat (limited to 'src/openvpn/socket.c')
-rw-r--r-- | src/openvpn/socket.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/openvpn/socket.c b/src/openvpn/socket.c index 6e68c18..0424c0b 100644 --- a/src/openvpn/socket.c +++ b/src/openvpn/socket.c @@ -137,10 +137,6 @@ openvpn_getaddrinfo (unsigned int flags, ASSERT(res); -#if defined(HAVE_RES_INIT) - res_init (); -#endif - if (!hostname) hostname = "::"; @@ -197,6 +193,9 @@ openvpn_getaddrinfo (unsigned int flags, */ while (true) { +#ifndef WIN32 + res_init (); +#endif /* try hostname lookup */ hints.ai_flags = 0; dmsg (D_SOCKET_DEBUG, "GETADDRINFO flags=0x%04x ai_family=%d ai_socktype=%d", @@ -215,10 +214,13 @@ openvpn_getaddrinfo (unsigned int flags, } else { + /* turn success into failure (interrupted syscall) */ if (0 == status) { ASSERT(res); freeaddrinfo(*res); - res = NULL; + *res = NULL; + status = EAI_AGAIN; /* = temporary failure */ + errno = EINTR; } goto done; } |