X-Git-Url: http://git.pk910.de/?a=blobdiff_plain;f=src%2FIOHandler%2FIOEngine_select.c;h=b725572067b32c213e5cd62894b1021a43710ec3;hb=78c9b3cbb2ecafa3b275c3eeafcf80796b7b3138;hp=c0405f4f89e50c93e42ebc8a4c2d5e2bd211b06c;hpb=9e6045c7b6d7afc774eeb59fa5f5c4e02fe1f037;p=NextIRCd.git diff --git a/src/IOHandler/IOEngine_select.c b/src/IOHandler/IOEngine_select.c index c0405f4..b725572 100644 --- a/src/IOHandler/IOEngine_select.c +++ b/src/IOHandler/IOEngine_select.c @@ -23,13 +23,14 @@ #include #include +#include +#include #ifdef WIN32 #define _WIN32_WINNT 0x501 #include #include -#else -#include -#include +#elif defined HAVE_SYS_SELECT_H +#include #endif /* compat */ @@ -93,8 +94,9 @@ static void engine_select_loop(struct timeval *timeout) { continue; if(iosock->fd > fds_size) fds_size = iosock->fd; - FD_SET(iosock->fd, &read_fds); select_result++; + if(iosocket_wants_reads(iosock)) + FD_SET(iosock->fd, &read_fds); if(iosocket_wants_writes(iosock)) FD_SET(iosock->fd, &write_fds); }