summaryrefslogtreecommitdiff
path: root/ev.c
diff options
context:
space:
mode:
Diffstat (limited to 'ev.c')
-rw-r--r--ev.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/ev.c b/ev.c
index b20112e..4e86506 100644
--- a/ev.c
+++ b/ev.c
@@ -3014,13 +3014,17 @@ once_cb (EV_P_ struct ev_once *once, int revents)
static void
once_cb_io (EV_P_ ev_io *w, int revents)
{
- once_cb (EV_A_ (struct ev_once *)(((char *)w) - offsetof (struct ev_once, io)), revents);
+ struct ev_once *once = (struct ev_once *)(((char *)w) - offsetof (struct ev_once, io));
+
+ once_cb (EV_A_ once, revents | ev_clear_pending (EV_A_ &once->to));
}
static void
once_cb_to (EV_P_ ev_timer *w, int revents)
{
- once_cb (EV_A_ (struct ev_once *)(((char *)w) - offsetof (struct ev_once, to)), revents);
+ struct ev_once *once = (struct ev_once *)(((char *)w) - offsetof (struct ev_once, to));
+
+ once_cb (EV_A_ once, revents | ev_clear_pending (EV_A_ &once->io));
}
void