diff options
Diffstat (limited to 'sample')
-rw-r--r-- | sample/signal-test.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/sample/signal-test.c b/sample/signal-test.c index f6316839..e8e39de9 100644 --- a/sample/signal-test.c +++ b/sample/signal-test.c @@ -49,6 +49,7 @@ int main (int argc, char **argv) { struct event signal_int; + struct event_base* base; #ifdef WIN32 WORD wVersionRequested; WSADATA wsaData; @@ -60,15 +61,16 @@ main (int argc, char **argv) #endif /* Initalize the event library */ - event_init(); + base = event_base_new(); /* Initalize one event */ - event_set(&signal_int, SIGINT, EV_SIGNAL|EV_PERSIST, signal_cb, + event_assign(&signal_int, base, SIGINT, EV_SIGNAL|EV_PERSIST, signal_cb, &signal_int); event_add(&signal_int, NULL); - event_dispatch(); + event_base_dispatch(base); + event_base_free(base); return (0); } |