- ev_io_set (&ev->iosig.io, ev->ev_fd, ev->ev_events & (EV_READ | EV_WRITE));
- ev_io_start (EV_A_ &ev->iosig.io);
+ if (!ev_is_active (&ev->iosig.io))
+ {
+ ev_io_set (&ev->iosig.io, ev->ev_fd, ev->ev_events & (EV_READ | EV_WRITE));
+ ev_io_start (EV_A_ &ev->iosig.io);
+
+ ev->ev_flags |= EVLIST_INSERTED;
+ }