]> granicus.if.org Git - libevent/commitdiff
Avoid giving a spurious warning when timerfd support is unavailable
authorDave Hart <hart@ntp.org>
Mon, 18 Jun 2012 14:31:38 +0000 (10:31 -0400)
committerNick Mathewson <nickm@torproject.org>
Mon, 18 Jun 2012 14:31:38 +0000 (10:31 -0400)
We forgot to do the obligatory "Check if there is no syscall there"
dance when calling timerfd_create().

(Commit message by Nick)

epoll.c

diff --git a/epoll.c b/epoll.c
index edd4e18b480a4e3bb4ba499edea36f6763d6aa46..91f0544b99ce5af26c454fcafb4323f3d621f7f1 100644 (file)
--- a/epoll.c
+++ b/epoll.c
@@ -190,7 +190,14 @@ epoll_init(struct event_base *base)
                                epollop->timerfd = -1;
                        }
                } else {
-                       event_warn("timerfd_create");
+                       if (errno != EINVAL && errno != ENOSYS) {
+                               /* These errors probably mean that we were
+                                * compiled with timerfd/TFD_* support, but
+                                * we're running on a kernel that lacks those.
+                                */
+                               event_warn("timerfd_create");
+                       }
+                       epollop->timerfd = -1;
                }
        } else {
                epollop->timerfd = -1;