… | |
… | |
33 | # include <time.h> |
33 | # include <time.h> |
34 | #endif |
34 | #endif |
35 | |
35 | |
36 | // for IOM_SIG |
36 | // for IOM_SIG |
37 | #if IOM_SIG |
37 | #if IOM_SIG |
38 | # include <signal.h> |
38 | # include <csignal> |
39 | # include <fcntl.h> |
39 | # include <fcntl.h> |
40 | #endif |
40 | #endif |
41 | |
41 | |
42 | // if the BSDs would at least be marginally POSIX-compatible.. *sigh* |
42 | // if the BSDs would at least be marginally POSIX-compatible.. *sigh* |
43 | // until that happens, sys/select.h must come last |
43 | // until that happens, sys/select.h must come last |
… | |
… | |
414 | for (int i = iow.size (); i--; ) |
414 | for (int i = iow.size (); i--; ) |
415 | if (!iow[i]) |
415 | if (!iow[i]) |
416 | iow.erase_unordered (i); |
416 | iow.erase_unordered (i); |
417 | else |
417 | else |
418 | { |
418 | { |
|
|
419 | io_watcher &w = *iow[i]; |
419 | short revents = iow[i]->events; |
420 | short revents = w.events; |
420 | |
421 | |
421 | if (!FD_ISSET (iow[i]->fd, &rfd)) revents &= ~EVENT_READ; |
422 | if (!FD_ISSET (w.fd, &rfd)) revents &= ~EVENT_READ; |
422 | if (!FD_ISSET (iow[i]->fd, &wfd)) revents &= ~EVENT_WRITE; |
423 | if (!FD_ISSET (w.fd, &wfd)) revents &= ~EVENT_WRITE; |
423 | |
424 | |
424 | if (revents) |
425 | if (revents) |
425 | iow[i]->call (*iow[i], revents); |
426 | w.call (w, revents); |
426 | } |
427 | } |
427 | #endif |
428 | #endif |
428 | } |
429 | } |
429 | else if (fds < 0 && errno != EINTR) |
430 | else if (fds < 0 && errno != EINTR) |
430 | { |
431 | { |