mirror of
https://github.com/nginx/nginx.git
synced 2026-11-21 15:45:27 +00:00
Control API: log errors from accepted socket setup
Accepted control connections discarded errno when setting close-on-exec, nonblocking I/O, or signal ownership. The error log identified the failed fcntl() operation but omitted the operating system reason. Pass ngx_socket_errno to the three error logs, consistently with listener setup and inherited socket handling.
This commit is contained in:
parent
1f868497b7
commit
1f214f4158
1 changed files with 3 additions and 3 deletions
|
|
@ -493,21 +493,21 @@ ngx_control_handle_accept(void)
|
|||
"control accept fd:%d", r->fd);
|
||||
|
||||
if (fcntl(r->fd, F_SETFD, FD_CLOEXEC) == -1) {
|
||||
ngx_log_error(NGX_LOG_ERR, ngx_cycle->log, 0,
|
||||
ngx_log_error(NGX_LOG_ERR, ngx_cycle->log, ngx_socket_errno,
|
||||
"control: fcntl(FD_CLOEXEC) failed");
|
||||
ngx_close_socket(r->fd);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (fcntl(r->fd, F_SETFL, O_ASYNC|O_NONBLOCK) == -1) {
|
||||
ngx_log_error(NGX_LOG_ERR, ngx_cycle->log, 0,
|
||||
ngx_log_error(NGX_LOG_ERR, ngx_cycle->log, ngx_socket_errno,
|
||||
"control: fcntl(O_ASYNC|O_NONBLOCK) failed");
|
||||
ngx_close_socket(r->fd);
|
||||
continue;
|
||||
}
|
||||
|
||||
if (fcntl(r->fd, F_SETOWN, ngx_pid) == -1) {
|
||||
ngx_log_error(NGX_LOG_ERR, ngx_cycle->log, 0,
|
||||
ngx_log_error(NGX_LOG_ERR, ngx_cycle->log, ngx_socket_errno,
|
||||
"control: fcntl(F_SETOWN) failed");
|
||||
ngx_close_socket(r->fd);
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue