Revision: 75951
          http://sourceforge.net/p/brlcad/code/75951
Author:   starseeker
Date:     2020-05-27 02:35:45 +0000 (Wed, 27 May 2020)
Log Message:
-----------
I think we need to call WSAGetLastError to get the right value here - without 
this, the regress-pkg test fails using the threaded approach on Windows.

Modified Paths:
--------------
    brlcad/trunk/src/libpkg/pkg.c

Modified: brlcad/trunk/src/libpkg/pkg.c
===================================================================
--- brlcad/trunk/src/libpkg/pkg.c       2020-05-27 01:52:01 UTC (rev 75950)
+++ brlcad/trunk/src/libpkg/pkg.c       2020-05-27 02:35:45 UTC (rev 75951)
@@ -765,6 +765,7 @@
            if (errno == EINTR)
                continue;
 #ifdef HAVE_WINSOCK_H
+               errno = WSAGetLastError();
            if (errno == WSAEWOULDBLOCK)
                return PKC_NULL;
 #else
@@ -772,6 +773,11 @@
                return PKC_NULL;
 #endif
            _pkg_perror(errlog, "pkg_getclient: accept");
+#ifdef HAVE_WINSOCK_H
+               char msgbuf[256] = { '\0' };
+               FormatMessage(FORMAT_MESSAGE_FROM_SYSTEM | 
FORMAT_MESSAGE_IGNORE_INSERTS, NULL, errno, MAKELANGID(LANG_NEUTRAL, 
SUBLANG_DEFAULT), msgbuf, sizeof(msgbuf), NULL);
+               _pkg_perror(errlog, (char *)msgbuf);
+#endif
            return PKC_ERROR;
        }
     }  while (s2 < 0);

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.



_______________________________________________
BRL-CAD Source Commits mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/brlcad-commits

Reply via email to