diff --git a/uloop-epoll.c b/uloop-epoll.c index d7b3acf..6513a75 100644 --- a/uloop-epoll.c +++ b/uloop-epoll.c @@ -162,7 +162,10 @@ static int timer_register(struct uloop_interval *tm, unsigned int msecs) static int timer_remove(struct uloop_interval *tm) { - int ret = __uloop_fd_delete(&tm->priv.ufd); + if (!tm->priv.ufd.registered) + return 0; + + int ret = uloop_fd_delete(&tm->priv.ufd); if (ret == 0) { close(tm->priv.ufd.fd);