[PATCH 2 of 4] Fixed unexpected ngx_socket_errno usage

Maxim Dounin mdounin at mdounin.ru
Sun Dec 28 17:36:48 UTC 2025


# HG changeset patch
# User Maxim Dounin <mdounin at mdounin.ru>
# Date 1766623505 -10800
#      Thu Dec 25 03:45:05 2025 +0300
# Node ID 5b137aa1f392d76b055c889bf25ebe66a191d343
# Parent  c348a55bad1160c1a503f0ae57352eb7ebfab74a
Fixed unexpected ngx_socket_errno usage.

The particular error is reported because the protocol family of an
inherited socket is not supported, and not because of a syscall error,
so ngx_socket_errno contains unrelated data and should not be used.

diff --git a/src/core/ngx_connection.c b/src/core/ngx_connection.c
--- a/src/core/ngx_connection.c
+++ b/src/core/ngx_connection.c
@@ -197,7 +197,7 @@ ngx_set_inherited_sockets(ngx_cycle_t *c
             break;
 
         default:
-            ngx_log_error(NGX_LOG_CRIT, cycle->log, ngx_socket_errno,
+            ngx_log_error(NGX_LOG_CRIT, cycle->log, 0,
                           "the inherited socket #%d has "
                           "an unsupported protocol family", ls[i].fd);
             ls[i].ignore = 1;



More information about the nginx-devel mailing list