Fwd: eio.c bug - use of errno without testing result
Micheil Smith
micheil at brandedcode.com
Fri Oct 29 01:45:34 CEST 2010
Hi All,
This was sent to the node.js development list, but looks like it's an
issue from within libeio.
Yours,
Micheil Smith
--
BrandedCode.com
Begin forwarded message:
> From: Liam <networkimprov at gmail.com>
> Date: 29 October 2010 6:31:54 AM AEDT
> To: nodejs-dev <nodejs-dev at googlegroups.com>
> Subject: eio.c bug - use of errno without testing result
> Reply-To: nodejs-dev at googlegroups.com
>
> eio.c : eio_execute() doesn't test the return value of any call for -1
> before using errno.
>
> sendfile(2) mysteriously sets the errno to ENOMEM, but correctly
> returns the size written, on 2 versions of Linux and 1 of FreeBSD.
> (See http://groups.google.com/group/nodejs/browse_thread/thread/795ebe75fdb1ac82)
>
> Possible Fix:
> case EIO_SENDFILE: req->result = eio__sendfile (req->int1, req->int2, req->offs, req->size, self);
> if (req->result >= 0) errno = 0; break;
>
> Liam
More information about the libev
mailing list