X-Git-Url: https://git.llucax.com/software/libev.git/blobdiff_plain/f432e03e319f1ece247021aa0810c4af1cb50042..aad25d9f3779968dc81e15e9eea4f10d78c008ff:/ev_select.c diff --git a/ev_select.c b/ev_select.c index 46a77e2..a0db3b6 100644 --- a/ev_select.c +++ b/ev_select.c @@ -1,4 +1,6 @@ /* + * libev select fd activity backend + * * Copyright (c) 2007 Marc Alexander Lehmann * All rights reserved. * @@ -33,7 +35,9 @@ #include /* for unix systems */ -#include +#ifndef WIN32 +# include +#endif #include #include @@ -70,7 +74,8 @@ select_modify (int fd, int oev, int nev) vec_wi [offs] &= ~mask; } -static void select_poll (ev_tstamp timeout) +static void +select_poll (ev_tstamp timeout) { struct timeval tv; int res; @@ -113,11 +118,14 @@ static void select_poll (ev_tstamp timeout) else if (res < 0) { if (errno == EBADF) - fd_recheck (); + fd_ebadf (); + else if (errno == ENOMEM) + fd_enomem (); } } -void select_init (int flags) +static void +select_init (int flags) { ev_method = EVMETHOD_SELECT; method_fudge = 1e-2; /* needed to compensate for select returning early, very conservative */ @@ -125,4 +133,3 @@ void select_init (int flags) method_poll = select_poll; } -