]> granicus.if.org Git - libevent/commitdiff
Catch attempts to event_base_once a persistent event.
authorNick Mathewson <nickm@torproject.org>
Wed, 29 Apr 2009 20:48:28 +0000 (20:48 +0000)
committerNick Mathewson <nickm@torproject.org>
Wed, 29 Apr 2009 20:48:28 +0000 (20:48 +0000)
svn:r1250

event.c

diff --git a/event.c b/event.c
index f09f4ff2cdd557f1bade258dcba817c9bb7cf35c..bf8d78c3f7bf08aeedb50618f90d739f4af5a860 100644 (file)
--- a/event.c
+++ b/event.c
@@ -930,8 +930,9 @@ event_base_once(struct event_base *base, evutil_socket_t fd, short events,
        struct timeval etv;
        int res = 0;
 
-       /* We cannot support signals that just fire once */
-       if (events & EV_SIGNAL)
+       /* We cannot support signals that just fire once, or persistent
+        * events. */
+       if (events & (EV_SIGNAL|EV_PERSIST))
                return (-1);
 
        if ((eonce = mm_calloc(1, sizeof(struct event_once))) == NULL)