invalid win32 accept() check in ev_pipe

Marc Lehmann schmorp at schmorp.de
Thu Nov 12 08:03:43 CET 2015


On Tue, Nov 10, 2015 at 11:28:26PM +0300, Vladimir Ivannikov <v.ivannikov at gaijin.ru> wrote:
> There is tiny bug in win32 implementation of ev_pipe() caused by the fact
> that accept() returns SOCKET type which is actually UINT_PTR on windows
> which of couse unsigned and can't be
> signed compared with 0 (compiler will just optimized this check out)
> Patch is trivial:

Hi, thanks for your interest!

Your analysis is correct and the patch is trivial, but of course breaks
this libev when accept returns a file descriptor (not all accept
implementations return handles). Since optimising the check out shouldn't
cause an issue either, it's not even a bug, and thus, I'd probably just
leave it as is for the moment, as the code seems correct as it stands, and
probably will remove error chekcing altogether in that place.

-- 
                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