Module: wine Branch: master Commit: 83a1789c559166ceb59255ed0f2c116cb5b13c96 URL: http://source.winehq.org/git/wine.git/?a=commit;h=83a1789c559166ceb59255ed0f...
Author: Dmitry Timoshkov dmitry@baikal.ru Date: Wed Dec 11 17:01:02 2013 +0900
ws2_32: Add a workaround for broken versions of glibc which return EAI_SYSTEM and set errno to 0 instead returning of EAI_NONAME.
---
dlls/ws2_32/socket.c | 8 ++++++++ 1 files changed, 8 insertions(+), 0 deletions(-)
diff --git a/dlls/ws2_32/socket.c b/dlls/ws2_32/socket.c index 304b0eb..79feb2b 100644 --- a/dlls/ws2_32/socket.c +++ b/dlls/ws2_32/socket.c @@ -5370,6 +5370,14 @@ static int convert_eai_u2w(int unixret) { for (i=0;ws_eai_map[i][0];i++) if (ws_eai_map[i][1] == unixret) return ws_eai_map[i][0]; + + if (unixret == EAI_SYSTEM) + /* There are broken versions of glibc which return EAI_SYSTEM + * and set errno to 0 instead of returning EAI_NONAME. + */ + return errno ? sock_get_error( errno ) : WS_EAI_NONAME; + + FIXME("Unhandled unix EAI_xxx ret %d\n", unixret); return unixret; }