Mercurial > hg > nginx
changeset 5557:188481078faf
Use ngx_socket_errno where appropriate.
Signed-off-by: Piotr Sikora <piotr@cloudflare.com>
author | Piotr Sikora <piotr@cloudflare.com> |
---|---|
date | Mon, 03 Feb 2014 14:17:17 -0800 |
parents | 4006bf77943b |
children | eeb3c2719147 |
files | src/core/ngx_connection.c src/http/ngx_http_request.c src/http/ngx_http_upstream.c src/os/unix/ngx_freebsd_sendfile_chain.c src/os/unix/ngx_linux_sendfile_chain.c |
diffstat | 5 files changed, 11 insertions(+), 11 deletions(-) [+] |
line wrap: on
line diff
--- a/src/core/ngx_connection.c Wed Feb 05 18:51:30 2014 +0400 +++ b/src/core/ngx_connection.c Mon Feb 03 14:17:17 2014 -0800 @@ -244,7 +244,7 @@ if (getsockopt(ls[i].fd, SOL_SOCKET, SO_ACCEPTFILTER, &af, &olen) == -1) { - err = ngx_errno; + err = ngx_socket_errno; if (err == NGX_EINVAL) { continue; @@ -277,7 +277,7 @@ if (getsockopt(ls[i].fd, IPPROTO_TCP, TCP_DEFER_ACCEPT, &timeout, &olen) == -1) { - err = ngx_errno; + err = ngx_socket_errno; if (err == NGX_EOPNOTSUPP) { continue; @@ -661,7 +661,7 @@ if (setsockopt(ls[i].fd, SOL_SOCKET, SO_ACCEPTFILTER, NULL, 0) == -1) { - ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, + ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_socket_errno, "setsockopt(SO_ACCEPTFILTER, NULL) " "for %V failed, ignored", &ls[i].addr_text); @@ -688,7 +688,7 @@ &af, sizeof(struct accept_filter_arg)) == -1) { - ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, + ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_socket_errno, "setsockopt(SO_ACCEPTFILTER, \"%s\") " "for %V failed, ignored", ls[i].accept_filter, &ls[i].addr_text); @@ -721,7 +721,7 @@ &value, sizeof(int)) == -1) { - ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno, + ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_socket_errno, "setsockopt(TCP_DEFER_ACCEPT, %d) for %V failed, " "ignored", value, &ls[i].addr_text);
--- a/src/http/ngx_http_request.c Wed Feb 05 18:51:30 2014 +0400 +++ b/src/http/ngx_http_request.c Mon Feb 03 14:17:17 2014 -0800 @@ -2707,7 +2707,7 @@ if (getsockopt(c->fd, SOL_SOCKET, SO_ERROR, (void *) &err, &len) == -1) { - err = ngx_errno; + err = ngx_socket_errno; } goto closed;
--- a/src/http/ngx_http_upstream.c Wed Feb 05 18:51:30 2014 +0400 +++ b/src/http/ngx_http_upstream.c Mon Feb 03 14:17:17 2014 -0800 @@ -1096,7 +1096,7 @@ if (getsockopt(c->fd, SOL_SOCKET, SO_ERROR, (void *) &err, &len) == -1) { - err = ngx_errno; + err = ngx_socket_errno; } if (err) { @@ -1977,7 +1977,7 @@ if (getsockopt(c->fd, SOL_SOCKET, SO_ERROR, (void *) &err, &len) == -1) { - err = ngx_errno; + err = ngx_socket_errno; } if (err) {
--- a/src/os/unix/ngx_freebsd_sendfile_chain.c Wed Feb 05 18:51:30 2014 +0400 +++ b/src/os/unix/ngx_freebsd_sendfile_chain.c Mon Feb 03 14:17:17 2014 -0800 @@ -231,7 +231,7 @@ && c->tcp_nopush == NGX_TCP_NOPUSH_UNSET) { if (ngx_tcp_nopush(c->fd) == NGX_ERROR) { - err = ngx_errno; + err = ngx_socket_errno; /* * there is a tiny chance to be interrupted, however,
--- a/src/os/unix/ngx_linux_sendfile_chain.c Wed Feb 05 18:51:30 2014 +0400 +++ b/src/os/unix/ngx_linux_sendfile_chain.c Mon Feb 03 14:17:17 2014 -0800 @@ -163,7 +163,7 @@ if (setsockopt(c->fd, IPPROTO_TCP, TCP_NODELAY, (const void *) &tcp_nodelay, sizeof(int)) == -1) { - err = ngx_errno; + err = ngx_socket_errno; /* * there is a tiny chance to be interrupted, however, @@ -189,7 +189,7 @@ if (c->tcp_nodelay == NGX_TCP_NODELAY_UNSET) { if (ngx_tcp_nopush(c->fd) == NGX_ERROR) { - err = ngx_errno; + err = ngx_socket_errno; /* * there is a tiny chance to be interrupted, however,