Catch attempts to event_base_once a persistent event.

svn:r1250
This commit is contained in:
Nick Mathewson 2009-04-29 20:48:28 +00:00
parent 1959414120
commit 37bc34662b

View File

@ -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)