]> git.ipfire.org Git - thirdparty/bind9.git/commitdiff
Extend log message for unexpected socket() errors
authorMichał Kępień <michal@isc.org>
Wed, 2 Dec 2020 21:36:23 +0000 (22:36 +0100)
committerOndřej Surý <ondrej@sury.org>
Wed, 9 Dec 2020 09:46:16 +0000 (10:46 +0100)
Make sure the error code is included in the message logged for
unexpected socket creation errors in order to facilitate troubleshooting
on Windows.

(cherry picked from commit dc2e1dea864b89f8dbf6365b395d6d0e292e9888)

lib/isc/netmgr/netmgr.c

index b946ede5bf90cc6fe063d86096c7d7c2b70e2596..9fc7a393312bae680d96fe142c4a84efb322e69e 100644 (file)
@@ -2053,8 +2053,10 @@ isc__nm_socket(int domain, int type, int protocol, uv_os_sock_t *sockp) {
                        return (ISC_R_FAMILYNOSUPPORT);
                default:
                        strerror_r(socket_errno, strbuf, sizeof(strbuf));
-                       UNEXPECTED_ERROR(__FILE__, __LINE__,
-                                        "socket() failed: %s", strbuf);
+                       UNEXPECTED_ERROR(
+                               __FILE__, __LINE__,
+                               "socket() failed with error code %lu: %s",
+                               socket_errno, strbuf);
                        return (ISC_R_UNEXPECTED);
                }
        }