Klaus Demo nginx / ab3c0f9
Use ngx_socket_errno where appropriate. Signed-off-by: Piotr Sikora <piotr@cloudflare.com> Piotr Sikora 8 years ago
5 changed file(s) with 11 addition(s) and 11 deletion(s). Raw diff Collapse all Expand all
243243 if (getsockopt(ls[i].fd, SOL_SOCKET, SO_ACCEPTFILTER, &af, &olen)
244244 == -1)
245245 {
246 err = ngx_errno;
246 err = ngx_socket_errno;
247247
248248 if (err == NGX_EINVAL) {
249249 continue;
276276 if (getsockopt(ls[i].fd, IPPROTO_TCP, TCP_DEFER_ACCEPT, &timeout, &olen)
277277 == -1)
278278 {
279 err = ngx_errno;
279 err = ngx_socket_errno;
280280
281281 if (err == NGX_EOPNOTSUPP) {
282282 continue;
660660 if (setsockopt(ls[i].fd, SOL_SOCKET, SO_ACCEPTFILTER, NULL, 0)
661661 == -1)
662662 {
663 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
663 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_socket_errno,
664664 "setsockopt(SO_ACCEPTFILTER, NULL) "
665665 "for %V failed, ignored",
666666 &ls[i].addr_text);
687687 &af, sizeof(struct accept_filter_arg))
688688 == -1)
689689 {
690 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
690 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_socket_errno,
691691 "setsockopt(SO_ACCEPTFILTER, \"%s\") "
692692 "for %V failed, ignored",
693693 ls[i].accept_filter, &ls[i].addr_text);
720720 &value, sizeof(int))
721721 == -1)
722722 {
723 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
723 ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_socket_errno,
724724 "setsockopt(TCP_DEFER_ACCEPT, %d) for %V failed, "
725725 "ignored",
726726 value, &ls[i].addr_text);
27062706 if (getsockopt(c->fd, SOL_SOCKET, SO_ERROR, (void *) &err, &len)
27072707 == -1)
27082708 {
2709 err = ngx_errno;
2709 err = ngx_socket_errno;
27102710 }
27112711
27122712 goto closed;
10951095 if (getsockopt(c->fd, SOL_SOCKET, SO_ERROR, (void *) &err, &len)
10961096 == -1)
10971097 {
1098 err = ngx_errno;
1098 err = ngx_socket_errno;
10991099 }
11001100
11011101 if (err) {
19761976 if (getsockopt(c->fd, SOL_SOCKET, SO_ERROR, (void *) &err, &len)
19771977 == -1)
19781978 {
1979 err = ngx_errno;
1979 err = ngx_socket_errno;
19801980 }
19811981
19821982 if (err) {
230230 && c->tcp_nopush == NGX_TCP_NOPUSH_UNSET)
231231 {
232232 if (ngx_tcp_nopush(c->fd) == NGX_ERROR) {
233 err = ngx_errno;
233 err = ngx_socket_errno;
234234
235235 /*
236236 * there is a tiny chance to be interrupted, however,
162162 if (setsockopt(c->fd, IPPROTO_TCP, TCP_NODELAY,
163163 (const void *) &tcp_nodelay, sizeof(int)) == -1)
164164 {
165 err = ngx_errno;
165 err = ngx_socket_errno;
166166
167167 /*
168168 * there is a tiny chance to be interrupted, however,
188188 if (c->tcp_nodelay == NGX_TCP_NODELAY_UNSET) {
189189
190190 if (ngx_tcp_nopush(c->fd) == NGX_ERROR) {
191 err = ngx_errno;
191 err = ngx_socket_errno;
192192
193193 /*
194194 * there is a tiny chance to be interrupted, however,