]> git.unchartedbackwaters.co.uk Git - francis/winuae.git/commitdiff
Fix serial socket creation so that it works under WINE
authorMatt Harlum <matt@harlum.net>
Fri, 29 May 2026 12:43:21 +0000 (00:43 +1200)
committerMatt Harlum <matt@harlum.net>
Wed, 3 Jun 2026 10:51:32 +0000 (22:51 +1200)
od-win32/parser.cpp

index 24a3366cc6a4d087f8b491a887d9245dba2551ad..e365347eb420158718044a180486dbc260317e6e 100644 (file)
@@ -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;