From: Matt Harlum Date: Fri, 29 May 2026 12:43:21 +0000 (+1200) Subject: Fix serial socket creation so that it works under WINE X-Git-Url: https://git.unchartedbackwaters.co.uk/w/?a=commitdiff_plain;h=f3a7a8284e18779012dd8a7deff9c54ab5b098e1;p=francis%2Fwinuae.git Fix serial socket creation so that it works under WINE --- diff --git a/od-win32/parser.cpp b/od-win32/parser.cpp index 24a3366c..e365347e 100644 --- a/od-win32/parser.cpp +++ b/od-win32/parser.cpp @@ -973,6 +973,11 @@ static int opentcp (const TCHAR *sername) bool waitmode = false; const int one = 1; const struct linger linger_1s = { 1, 1 }; + ADDRINFOW hints = {0}; + + hints.ai_family = AF_INET; + hints.ai_socktype = SOCK_STREAM; + hints.ai_protocol = IPPROTO_TCP; if (WSAStartup (MAKEWORD (2, 2), &wsadata)) { DWORD lasterror = WSAGetLastError (); @@ -999,7 +1004,7 @@ static int opentcp (const TCHAR *sername) if (!port) port = my_strdup (_T("1234")); - err = GetAddrInfoW (name, port, NULL, &socketinfo); + err = GetAddrInfoW (name, port, &hints, &socketinfo); if (err < 0) { write_log (_T("SERIAL_TCP: GetAddrInfoW() failed, %s:%s: %d\n"), name, port, WSAGetLastError ()); goto end;