eio.c bug - use of errno without testing result

Marc Lehmann schmorp at schmorp.de
Fri Oct 29 16:23:05 CEST 2010


On Sat, Oct 30, 2010 at 12:40:09AM +1100, Micheil Smith <micheil at brandedcode.com> wrote:
> Given something like a call to EIO_OPEN, how should we be checking for an error, 
> would I be right in thinking that we should look at ev_set_syserr_cb?

EIO_OPEN works like open(), so if req->result is -1 (or < 0), then you can
look at err(or(no to see what went wrong.

> because if error handling can be improved, I'd be all for learning how to improve it.

How you handle the error depends on the language you use, libeio implements
C semantics, how you map that is a matter of personal taste.

This problem is not, however, error handling and how it can be improved -
there is only right and wrong, and looking at errno without determining
failure is wrong with or without libeio.

-- 
                The choice of a       Deliantra, the free code+content MORPG
      -----==-     _GNU_              http://www.deliantra.net
      ----==-- _       generation
      ---==---(_)__  __ ____  __      Marc Lehmann
      --==---/ / _ \/ // /\ \/ /      schmorp at schmorp.de
      -=====/_/_//_/\_,_/ /_/\_\



More information about the libev mailing list