diff --git a/src/os/unix/ngx_darwin_init.c b/src/os/unix/ngx_darwin_init.c index c3d1125fc..6ca1ca750 100644 --- a/src/os/unix/ngx_darwin_init.c +++ b/src/os/unix/ngx_darwin_init.c @@ -88,7 +88,6 @@ ngx_debug_init() ngx_int_t ngx_os_specific_init(ngx_log_t *log) { - int somaxconn; size_t size; ngx_err_t err; ngx_uint_t i; @@ -155,12 +154,9 @@ ngx_os_specific_init(ngx_log_t *log) ngx_ncpu = ngx_darwin_hw_ncpu; - somaxconn = 32676; - - if (ngx_darwin_kern_ipc_somaxconn > somaxconn) { + if (ngx_darwin_kern_ipc_somaxconn > 32767) { ngx_log_error(NGX_LOG_ALERT, log, 0, - "sysctl kern.ipc.somaxconn must be no more than %d", - somaxconn); + "sysctl kern.ipc.somaxconn must be less than 32768"); return NGX_ERROR; } diff --git a/src/os/unix/ngx_freebsd_init.c b/src/os/unix/ngx_freebsd_init.c index bfb89087a..8edce42f6 100644 --- a/src/os/unix/ngx_freebsd_init.c +++ b/src/os/unix/ngx_freebsd_init.c @@ -98,7 +98,7 @@ ngx_debug_init() ngx_int_t ngx_os_specific_init(ngx_log_t *log) { - int version, somaxconn; + int version; size_t size; ngx_err_t err; ngx_uint_t i; @@ -210,12 +210,9 @@ ngx_os_specific_init(ngx_log_t *log) ngx_ncpu = ngx_freebsd_hw_ncpu; } - somaxconn = version < 600008 ? 32676 : 65535; - - if (ngx_freebsd_kern_ipc_somaxconn > somaxconn) { + if (version < 600008 && ngx_freebsd_kern_ipc_somaxconn > 32767) { ngx_log_error(NGX_LOG_ALERT, log, 0, - "sysctl kern.ipc.somaxconn must be no more than %d", - somaxconn); + "sysctl kern.ipc.somaxconn must be less than 32768"); return NGX_ERROR; }