]> 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)
committerMichał Kępień <michal@isc.org>
Wed, 2 Dec 2020 21:36:23 +0000 (22:36 +0100)
Make sure the error code is included in the message logged for
unexpected socket creation errors in order to facilitate troubleshooting
on Windows.

lib/isc/netmgr/netmgr.c

index 9feae4f8a48a58f9cab6784fc7a11b9abf2e173a..0a3266c48cef008836afdee7657f8d8cd8f1280a 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);
                }
        }