- ev_init (&once->to, once_cb_to);
- if (timeout >= 0.)
- {
- ev_timer_set (&once->to, timeout, 0.);
- ev_timer_start (EV_A_ &once->to);
- }
+ ev_init (&once->io, once_cb_io);
+ if (fd >= 0)
+ {
+ ev_io_set (&once->io, fd, events);
+ ev_io_start (EV_A_ &once->io);
+ }
+
+ ev_init (&once->to, once_cb_to);
+ if (timeout >= 0.)
+ {
+ ev_timer_set (&once->to, timeout, 0.);
+ ev_timer_start (EV_A_ &once->to);