[PATCH] Use ngx_socket_errno where appropriate.

Igor Sysoev igor at sysoev.ru
Fri Jan 31 05:38:08 UTC 2014

On Jan 31, 2014, at 8:35 , Ruslan Ermilov wrote:

> Hi Piotr,
> On Thu, Jan 30, 2014 at 04:16:04PM -0800, Piotr Sikora wrote:

[ ... ]

> These seem questionable to me because the ioctl/fcntl calls are
> known to report back in errno, and they're not wrapped into ngx_foo()
> calls here.
> My own preferences are as follows.
> Use "ngx_errno" if we directly call ioctl/fcntl from the UNIX context.
> I'd even prefer using "errno" here, but that doesn't seem to agree
> with the current code.  Still, some code uses "errno" here, and that
> perhaps should be fixed as well.
> Use "ngx_socket_errno" for socket-related calls, including wrappers
> such as ngx_nonblocking() known to apply to exclusively to sockets.

Yes, ngx_socket_errno should used only for socket-related calls and
only in cross-plarform parts which can be compiled on no-Unix platform
(that is on Windows).

Igor Sysoev

More information about the nginx-devel mailing list