Core: fixed errno clobbering in ngx_sendmsg().

This was broken by 2dfd313f22f2.
This commit is contained in:
Vladimir Homutov 2021-07-20 12:04:58 +03:00
parent 6750340391
commit f59b487a69

View file

@ -398,15 +398,6 @@ eintr:
n = sendmsg(c->fd, msg, flags);
#if (NGX_DEBUG)
for (i = 0, size = 0; i < (size_t) msg->msg_iovlen; i++) {
size += msg->msg_iov[i].iov_len;
}
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
"sendmsg: %z of %uz", n, size);
#endif
if (n == -1) {
err = ngx_errno;
@ -428,5 +419,14 @@ eintr:
}
}
#if (NGX_DEBUG)
for (i = 0, size = 0; i < (size_t) msg->msg_iovlen; i++) {
size += msg->msg_iov[i].iov_len;
}
ngx_log_debug2(NGX_LOG_DEBUG_EVENT, c->log, 0,
"sendmsg: %z of %uz", n, size);
#endif
return n;
}