]> granicus.if.org Git - libevent/commitdiff
deprecate the usage of signal_{add,del,set} and name it evsignal_{add,del,set} instea...
authorNiels Provos <provos@gmail.com>
Tue, 23 Dec 2008 22:23:37 +0000 (22:23 +0000)
committerNiels Provos <provos@gmail.com>
Tue, 23 Dec 2008 22:23:37 +0000 (22:23 +0000)
svn:r973

14 files changed:
WIN32-Code/win32.c
devpoll.c
epoll.c
event-internal.h
event.c
evport.c
evsignal.h
include/event2/event.h
include/event2/event_compat.h
kqueue.c
poll.c
select.c
signal.c
test/regress.c

index e91853f23973bb36fe93c91ad4f56595cd0098ab..f2d6a3ba57092d44c9d0bd3f49b79e42c755075a 100644 (file)
@@ -241,7 +241,7 @@ win32_init(struct event_base *_base)
        winop->readset_out->fd_count = winop->writeset_out->fd_count
                = winop->exset_out->fd_count = 0;
 
-       evsignal_init(_base);
+       evsig_init(_base);
 
        return (winop);
  err:
@@ -337,7 +337,7 @@ win32_dispatch(struct event_base *base, struct timeval *tv)
        if (!fd_count) {
                /* Windows doesn't like you to call select() with no sockets */
                Sleep(timeval_to_ms(tv));
-               evsignal_process(base);
+               evsig_process(base);
                return (0);
        }
 
@@ -349,10 +349,10 @@ win32_dispatch(struct event_base *base, struct timeval *tv)
        event_debug(("%s: select returned %d", __func__, res));
 
        if(res <= 0) {
-               evsignal_process(base);
+               evsig_process(base);
                return res;
-       } else if (base->sig.evsignal_caught) {
-               evsignal_process(base);
+       } else if (base->sig.evsig_caught) {
+               evsig_process(base);
        }
 
        for (i=0; i<win32op->readset_out->fd_count; ++i) {
@@ -379,7 +379,7 @@ win32_dealloc(struct event_base *_base)
 {
        struct win32op *win32op = _base->evbase;
 
-       evsignal_dealloc(_base);
+       evsig_dealloc(_base);
        if (win32op->readset_in)
                mm_free(win32op->readset_in);
        if (win32op->writeset_in)
index b87d67222bc9ae395314a873a6b11c5cbee121b0..3a849cd5d4a27e0c0daa35976e3df97a712ed434 100644 (file)
--- a/devpoll.c
+++ b/devpoll.c
@@ -156,7 +156,7 @@ devpoll_init(struct event_base *base)
                return (NULL);
        }
 
-       evsignal_init(base);
+       evsig_init(base);
 
        return (devpollop);
 }
@@ -188,10 +188,10 @@ devpoll_dispatch(struct event_base *base, struct timeval *tv)
                        return (-1);
                }
 
-               evsignal_process(base);
+               evsig_process(base);
                return (0);
-       } else if (base->sig.evsignal_caught) {
-               evsignal_process(base);
+       } else if (base->sig.evsig_caught) {
+               evsig_process(base);
        }
 
        event_debug(("%s: devpoll_wait reports %d", __func__, res));
@@ -302,7 +302,7 @@ devpoll_dealloc(struct event_base *base)
 {
        struct devpollop *devpollop = base->evbase;
 
-       evsignal_dealloc(base);
+       evsig_dealloc(base);
        if (devpollop->events)
                mm_free(devpollop->events);
        if (devpollop->changes)
diff --git a/epoll.c b/epoll.c
index 511dbbee6bf875c89cfe24433d895460b291323e..24ce52ae4a394bb8a108cf8243e498d195879fca 100644 (file)
--- a/epoll.c
+++ b/epoll.c
@@ -135,7 +135,7 @@ epoll_init(struct event_base *base)
        }
        epollop->nevents = nfiles;
 
-       evsignal_init(base);
+       evsig_init(base);
 
        return (epollop);
 }
@@ -164,10 +164,10 @@ epoll_dispatch(struct event_base *base, struct timeval *tv)
                        return (-1);
                }
 
-               evsignal_process(base);
+               evsig_process(base);
                return (0);
-       } else if (base->sig.evsignal_caught) {
-               evsignal_process(base);
+       } else if (base->sig.evsig_caught) {
+               evsig_process(base);
        }
 
        event_debug(("%s: epoll_wait reports %d", __func__, res));
@@ -262,7 +262,7 @@ epoll_dealloc(struct event_base *base)
 {
        struct epollop *epollop = base->evbase;
 
-       evsignal_dealloc(base);
+       evsig_dealloc(base);
        if (epollop->events)
                mm_free(epollop->events);
        if (epollop->epfd >= 0)
index d6ed4b12b1ee0d7a18db6f3b9b2d8a43baa86cab..7bf4ca5849e0330058048045b4a9eda3246993d8 100644 (file)
@@ -72,7 +72,7 @@ struct event_base {
        const struct eventop *evsigsel;
        void *evsigbase;
 
-       struct evsignal_info sig;
+       struct evsig_info sig;
 
        int event_count;                /* counts number of total events */
        int event_count_active; /* counts number of active events */
@@ -141,9 +141,9 @@ struct event_config {
 } while (0)
 #endif /* TAILQ_FOREACH */
 
-int _evsignal_set_handler(struct event_base *base, int evsignal,
+int _evsig_set_handler(struct event_base *base, int evsignal,
                          void (*fn)(int));
-int _evsignal_restore_handler(struct event_base *base, int evsignal);
+int _evsig_restore_handler(struct event_base *base, int evsignal);
 
 #ifdef __cplusplus
 }
diff --git a/event.c b/event.c
index 2d43d0a945da9bb27ef6c24dea7539a4972e6e17..aa1c25ef571d8c4e1d711c56b4975002531e134d 100644 (file)
--- a/event.c
+++ b/event.c
@@ -118,7 +118,7 @@ static const struct eventop *eventops[] = {
 
 /* Global state */
 struct event_base *current_base = NULL;
-extern struct event_base *evsignal_base;
+extern struct event_base *evsig_base;
 static int use_monotonic;
 
 /* Handle signals - This is a deprecated interface */
@@ -711,7 +711,7 @@ event_base_loop(struct event_base *base, int flags)
        base->tv_cache.tv_sec = 0;
 
        if (base->sig.ev_signal_added)
-               evsignal_base = base;
+               evsig_base = base;
        done = 0;
        while (!done) {
                /* Terminate the loop if we have been asked to */
index 02019da43a0f331c42ec50f828a58e9458c7933b..521ffbb64de23c977563cc6155ef3973b2f5ba48 100644 (file)
--- a/evport.c
+++ b/evport.c
@@ -160,7 +160,7 @@ evport_init(struct event_base *base)
        for (i = 0; i < EVENTS_PER_GETN; i++)
                evpd->ed_pending[i] = -1;
 
-       evsignal_init(base);
+       evsig_init(base);
 
        return (evpd);
 }
@@ -305,7 +305,7 @@ evport_dispatch(struct event_base *base, struct timeval *tv)
        if ((res = port_getn(epdp->ed_port, pevtlist, EVENTS_PER_GETN, 
                    (unsigned int *) &nevents, ts_p)) == -1) {
                if (errno == EINTR || errno == EAGAIN) {
-                       evsignal_process(base);
+                       evsig_process(base);
                        return (0);
                } else if (errno == ETIME) {
                        if (nevents == 0)
@@ -314,8 +314,8 @@ evport_dispatch(struct event_base *base, struct timeval *tv)
                        event_warn("port_getn");
                        return (-1);
                }
-       } else if (base->sig.evsignal_caught) {
-               evsignal_process(base);
+       } else if (base->sig.evsig_caught) {
+               evsig_process(base);
        }
        
        event_debug(("%s: port_getn reports %d events", __func__, nevents));
@@ -447,7 +447,7 @@ evport_dealloc(struct event_base *base)
 {
        struct evport_data *evpd = base->evbase;
 
-       evsignal_dealloc(base);
+       evsig_dealloc(base);
 
        close(evpd->ed_port);
 
index 298f6ae1e3aceebf177ba613810e63c5e26b9cde..5e380d43502aae8e740841733f056068608e3412 100644 (file)
 
 typedef void (*ev_sighandler_t)(int);
 
-struct evsignal_info {
+struct evsig_info {
        struct event ev_signal;
        evutil_socket_t ev_signal_pair[2];
        int ev_signal_added;
-       volatile sig_atomic_t evsignal_caught;
+       volatile sig_atomic_t evsig_caught;
        sig_atomic_t evsigcaught[NSIG];
 #ifdef HAVE_SIGACTION
        struct sigaction **sh_old;
@@ -46,8 +46,8 @@ struct evsignal_info {
 #endif
        int sh_old_max;
 };
-void evsignal_init(struct event_base *);
-void evsignal_process(struct event_base *);
-void evsignal_dealloc(struct event_base *);
+void evsig_init(struct event_base *);
+void evsig_process(struct event_base *);
+void evsig_dealloc(struct event_base *);
 
 #endif /* _EVSIGNAL_H_ */
index 7fdae30460629f31d243b648e5b6f107c67ea804..a8b39e96d5d9f4908792a5351756d12e32c63314 100644 (file)
@@ -340,16 +340,16 @@ void evperiodic_assign(struct event *ev, struct event_base *base,
 #define evtimer_pending(ev, tv)                event_pending(ev, EV_TIMEOUT, tv)
 #define evtimer_initialized(ev)                _event_initialized((ev), 0)
 
-#define signal_add(ev, tv)             event_add(ev, tv)
-#define signal_set(ev, x, cb, arg)     \
+#define evsignal_add(ev, tv)           event_add(ev, tv)
+#define evsignal_set(ev, x, cb, arg)   \
        event_set(ev, x, EV_SIGNAL|EV_PERSIST, cb, arg)
-#define signal_assign(ev, b, x, cb, arg)                    \
+#define evsignal_assign(ev, b, x, cb, arg)                   \
        event_assign(ev, b, x, EV_SIGNAL|EV_PERSIST, cb, arg)
-#define signal_new(b, x, cb, arg) \
+#define evsignal_new(b, x, cb, arg) \
        event_new(b, x, EV_SIGNAL|EV_PERSIST, cb, arg)
-#define signal_del(ev)                 event_del(ev)
-#define signal_pending(ev, tv)         event_pending(ev, EV_SIGNAL, tv)
-#define signal_initialized(ev)         _event_initialized((ev), 0)
+#define evsignal_del(ev)               event_del(ev)
+#define evsignal_pending(ev, tv)       event_pending(ev, EV_SIGNAL, tv)
+#define evsignal_initialized(ev)       _event_initialized((ev), 0)
 
 /**
   Prepare an event structure to be added.
index c9a86ccfe9364db4b129fad3bbee53e33afee2fa..1b506313ec62ba0b2a31ffeeaf3a0912447a5d70 100644 (file)
@@ -201,6 +201,17 @@ int        event_priority_init(int);
 #define timeout_pending(ev, tv)                event_pending(ev, EV_TIMEOUT, tv)
 #define timeout_initialized(ev)                _event_initialized((ev), 0)
 
+#define signal_add(ev, tv)             event_add(ev, tv)
+#define signal_set(ev, x, cb, arg)     \
+       event_set(ev, x, EV_SIGNAL|EV_PERSIST, cb, arg)
+#define signal_assign(ev, b, x, cb, arg)                    \
+       event_assign(ev, b, x, EV_SIGNAL|EV_PERSIST, cb, arg)
+#define signal_new(b, x, cb, arg) \
+       event_new(b, x, EV_SIGNAL|EV_PERSIST, cb, arg)
+#define signal_del(ev)                 event_del(ev)
+#define signal_pending(ev, tv)         event_pending(ev, EV_SIGNAL, tv)
+#define signal_initialized(ev)         _event_initialized((ev), 0)
+
 #ifdef __cplusplus
 }
 #endif
index fc0c96a6ff4a1867162b52f5ad67435f461d0686..a96489124fed3cdead744ad6ac8b27a146e8d2cc 100644 (file)
--- a/kqueue.c
+++ b/kqueue.c
@@ -394,7 +394,7 @@ kq_sig_add(struct event_base *base, int nsignal, short old, short events)
        if (kevent(kqop->kq, &kev, 1, NULL, 0, &timeout) == -1)
                return (-1);
                        
-       if (_evsignal_set_handler(base, nsignal, kq_sighandler) == -1)
+       if (_evsig_set_handler(base, nsignal, kq_sighandler) == -1)
                return (-1);
 
        return (0);
@@ -421,7 +421,7 @@ kq_sig_del(struct event_base *base, int nsignal, short old, short events)
        if (kevent(kqop->kq, &kev, 1, NULL, 0, &timeout) == -1)
                return (-1);
 
-       if (_evsignal_restore_handler(base, nsignal) == -1)
+       if (_evsig_restore_handler(base, nsignal) == -1)
                return (-1);
 
        return (0);
diff --git a/poll.c b/poll.c
index 9b7b85bd9753088f4521b0d3ab3f49a2be883b96..a533539858e5d569413cbcdf52edbb2ee58fa737 100644 (file)
--- a/poll.c
+++ b/poll.c
@@ -86,7 +86,7 @@ poll_init(struct event_base *base)
        if (!(pollop = mm_calloc(1, sizeof(struct pollop))))
                return (NULL);
 
-       evsignal_init(base);
+       evsig_init(base);
 
        return (pollop);
 }
@@ -133,10 +133,10 @@ poll_dispatch(struct event_base *base, struct timeval *tv)
                        return (-1);
                }
 
-               evsignal_process(base);
+               evsig_process(base);
                return (0);
-       } else if (base->sig.evsignal_caught) {
-               evsignal_process(base);
+       } else if (base->sig.evsig_caught) {
+               evsig_process(base);
        }
 
        event_debug(("%s: poll reports %d", __func__, res));
@@ -295,7 +295,7 @@ poll_dealloc(struct event_base *base)
 {
        struct pollop *pop = base->evbase;
 
-       evsignal_dealloc(base);
+       evsig_dealloc(base);
        if (pop->event_set)
                mm_free(pop->event_set);
        if (pop->idxplus1_by_fd)
index 4bf95180efdc79c91dd2bf5cd2a69b644f13c7e2..31c7598a930877a770abd0e0e1a6939797c69812 100644 (file)
--- a/select.c
+++ b/select.c
@@ -95,7 +95,7 @@ select_init(struct event_base *base)
 
        select_resize(sop, howmany(32 + 1, NFDBITS)*sizeof(fd_mask));
 
-       evsignal_init(base);
+       evsig_init(base);
 
        return (sop);
 }
@@ -134,10 +134,10 @@ select_dispatch(struct event_base *base, struct timeval *tv)
                        return (-1);
                }
 
-               evsignal_process(base);
+               evsig_process(base);
                return (0);
-       } else if (base->sig.evsignal_caught) {
-               evsignal_process(base);
+       } else if (base->sig.evsig_caught) {
+               evsig_process(base);
        }
 
        event_debug(("%s: select reports %d", __func__, res));
@@ -278,7 +278,7 @@ select_dealloc(struct event_base *base)
 {
        struct selectop *sop = base->evbase;
 
-       evsignal_dealloc(base);
+       evsig_dealloc(base);
        if (sop->event_readset_in)
                mm_free(sop->event_readset_in);
        if (sop->event_writeset_in)
index f3356c930622a7c97d6f7438e86ef4a73b0a0930..844b8b4eb60a593bf5240495450ba5a6114ff1a0 100644 (file)
--- a/signal.c
+++ b/signal.c
 #include "log.h"
 #include "evmap.h"
 
-static int evsignal_add(struct event_base *, int, short, short);
-static int evsignal_del(struct event_base *, int, short, short);
+static int evsig_add(struct event_base *, int, short, short);
+static int evsig_del(struct event_base *, int, short, short);
 
 static const struct eventop evsigops = {
        "signal",
        NULL,
-       evsignal_add,
-       evsignal_del,
+       evsig_add,
+       evsig_del,
        NULL,
        NULL,
        0, 0
 };
 
-struct event_base *evsignal_base = NULL;
+struct event_base *evsig_base = NULL;
 
-static void evsignal_handler(int sig);
+static void evsig_handler(int sig);
 
 /* Callback for when the signal handler write a byte to our signaling socket */
 static void
-evsignal_cb(evutil_socket_t fd, short what, void *arg)
+evsig_cb(evutil_socket_t fd, short what, void *arg)
 {
        static char signals[100];
 #ifdef WIN32
@@ -109,7 +109,7 @@ evsignal_cb(evutil_socket_t fd, short what, void *arg)
 #endif
 
 void
-evsignal_init(struct event_base *base)
+evsig_init(struct event_base *base)
 {
        /* 
         * Our signal handler is going to write to one end of the socket
@@ -124,13 +124,13 @@ evsignal_init(struct event_base *base)
        FD_CLOSEONEXEC(base->sig.ev_signal_pair[1]);
        base->sig.sh_old = NULL;
        base->sig.sh_old_max = 0;
-       base->sig.evsignal_caught = 0;
+       base->sig.evsig_caught = 0;
        memset(&base->sig.evsigcaught, 0, sizeof(sig_atomic_t)*NSIG);
 
         evutil_make_socket_nonblocking(base->sig.ev_signal_pair[0]);
 
        event_assign(&base->sig.ev_signal, base, base->sig.ev_signal_pair[1],
-               EV_READ | EV_PERSIST, evsignal_cb, &base->sig.ev_signal);
+               EV_READ | EV_PERSIST, evsig_cb, &base->sig.ev_signal);
 
        base->sig.ev_signal.ev_flags |= EVLIST_INTERNAL;
 
@@ -141,7 +141,7 @@ evsignal_init(struct event_base *base)
 /* Helper: set the signal handler for evsignal to handler in base, so that
  * we can restore the original handler when we clear the current one. */
 int
-_evsignal_set_handler(struct event_base *base,
+_evsig_set_handler(struct event_base *base,
                      int evsignal, void (*handler)(int))
 {
 #ifdef HAVE_SIGACTION
@@ -149,7 +149,7 @@ _evsignal_set_handler(struct event_base *base,
 #else
        ev_sighandler_t sh;
 #endif
-       struct evsignal_info *sig = &base->sig;
+       struct evsig_info *sig = &base->sig;
        void *p;
 
        /*
@@ -205,18 +205,18 @@ _evsignal_set_handler(struct event_base *base,
 }
 
 static int
-evsignal_add(struct event_base *base, int evsignal, short old, short events)
+evsig_add(struct event_base *base, int evsignal, short old, short events)
 {
-       struct evsignal_info *sig = &base->sig;
+       struct evsig_info *sig = &base->sig;
 
        assert(evsignal >= 0 && evsignal < NSIG);
 
        event_debug(("%s: %p: changing signal handler", __func__, ev));
-       if (_evsignal_set_handler(base, evsignal, evsignal_handler) == -1)
+       if (_evsig_set_handler(base, evsignal, evsig_handler) == -1)
                return (-1);
 
        /* catch signals if they happen quickly */
-       evsignal_base = base;
+       evsig_base = base;
 
        if (!sig->ev_signal_added) {
                if (event_add(&sig->ev_signal, NULL))
@@ -228,10 +228,10 @@ evsignal_add(struct event_base *base, int evsignal, short old, short events)
 }
 
 int
-_evsignal_restore_handler(struct event_base *base, int evsignal)
+_evsig_restore_handler(struct event_base *base, int evsignal)
 {
        int ret = 0;
-       struct evsignal_info *sig = &base->sig;
+       struct evsig_info *sig = &base->sig;
 #ifdef HAVE_SIGACTION
        struct sigaction *sh;
 #else
@@ -259,39 +259,39 @@ _evsignal_restore_handler(struct event_base *base, int evsignal)
 }
 
 static int
-evsignal_del(struct event_base *base, int evsignal, short old, short events)
+evsig_del(struct event_base *base, int evsignal, short old, short events)
 {
        assert(evsignal >= 0 && evsignal < NSIG);
 
        event_debug(("%s: %p: restoring signal handler", __func__, ev));
 
-       return (_evsignal_restore_handler(base, evsignal));
+       return (_evsig_restore_handler(base, evsignal));
 }
 
 static void
-evsignal_handler(int sig)
+evsig_handler(int sig)
 {
        int save_errno = errno;
 #ifdef WIN32
        int socket_errno = EVUTIL_SOCKET_ERROR();
 #endif
 
-       if (evsignal_base == NULL) {
+       if (evsig_base == NULL) {
                event_warn(
                        "%s: received signal %d, but have no base configured",
                        __func__, sig);
                return;
        }
 
-       evsignal_base->sig.evsigcaught[sig]++;
-       evsignal_base->sig.evsignal_caught = 1;
+       evsig_base->sig.evsigcaught[sig]++;
+       evsig_base->sig.evsig_caught = 1;
 
 #ifndef HAVE_SIGACTION
-       signal(sig, evsignal_handler);
+       signal(sig, evsig_handler);
 #endif
 
        /* Wake up our notification mechanism */
-       send(evsignal_base->sig.ev_signal_pair[0], "a", 1, 0);
+       send(evsig_base->sig.ev_signal_pair[0], "a", 1, 0);
        errno = save_errno;
 #ifdef WIN32
        EVUTIL_SET_SOCKET_ERROR(socket_errno);
@@ -299,13 +299,13 @@ evsignal_handler(int sig)
 }
 
 void
-evsignal_process(struct event_base *base)
+evsig_process(struct event_base *base)
 {
-       struct evsignal_info *sig = &base->sig;
+       struct evsig_info *sig = &base->sig;
        sig_atomic_t ncalls;
        int i;
        
-       base->sig.evsignal_caught = 0;
+       base->sig.evsig_caught = 0;
        for (i = 1; i < NSIG; ++i) {
                ncalls = sig->evsigcaught[i];
                if (ncalls == 0)
@@ -317,7 +317,7 @@ evsignal_process(struct event_base *base)
 }
 
 void
-evsignal_dealloc(struct event_base *base)
+evsig_dealloc(struct event_base *base)
 {
        int i = 0;
        if (base->sig.ev_signal_added) {
@@ -326,7 +326,7 @@ evsignal_dealloc(struct event_base *base)
        }
        for (i = 0; i < NSIG; ++i) {
                if (i < base->sig.sh_old_max && base->sig.sh_old[i] != NULL)
-                       _evsignal_restore_handler(base, i);
+                       _evsig_restore_handler(base, i);
        }
 
        EVUTIL_CLOSESOCKET(base->sig.ev_signal_pair[0]);
@@ -335,6 +335,6 @@ evsignal_dealloc(struct event_base *base)
        base->sig.ev_signal_pair[1] = -1;
        base->sig.sh_old_max = 0;
 
-       /* per index frees are handled in evsignal_del() */
+       /* per index frees are handled in evsig_del() */
        mm_free(base->sig.sh_old);
 }
index 3bba52ad053ec89e3bf221e4f09e9e90f78f09b7..d020af0c6e714a0ce5709988aae455072f0cc01d 100644 (file)
@@ -540,8 +540,8 @@ test_fork(void)
        if (event_add(&ev, NULL) == -1)
                exit(1);
 
-       signal_set(&sig_ev, SIGCHLD, child_signal_cb, &got_sigchld);
-       signal_add(&sig_ev, NULL);
+       evsignal_set(&sig_ev, SIGCHLD, child_signal_cb, &got_sigchld);
+       evsignal_add(&sig_ev, NULL);
 
        if ((pid = fork()) == 0) {
                /* in the child */
@@ -550,7 +550,7 @@ test_fork(void)
                        exit(1);
                }
 
-               signal_del(&sig_ev);
+               evsignal_del(&sig_ev);
 
                called = 0;
 
@@ -590,7 +590,7 @@ test_fork(void)
                exit(1);
        }
 
-       signal_del(&sig_ev);
+       evsignal_del(&sig_ev);
 
        cleanup_test();
 }
@@ -606,7 +606,7 @@ signal_cb(int fd, short event, void *arg)
 {
        struct event *ev = arg;
 
-       signal_del(ev);
+       evsignal_del(ev);
        test_ok = 1;
 }
 
@@ -617,11 +617,11 @@ test_simplesignal(void)
        struct itimerval itv;
 
        setup_test("Simple signal: ");
-       signal_set(&ev, SIGALRM, signal_cb, &ev);
-       signal_add(&ev, NULL);
+       evsignal_set(&ev, SIGALRM, signal_cb, &ev);
+       evsignal_add(&ev, NULL);
        /* find bugs in which operations are re-ordered */
-       signal_del(&ev);
-       signal_add(&ev, NULL);
+       evsignal_del(&ev);
+       evsignal_add(&ev, NULL);
 
        memset(&itv, 0, sizeof(itv));
        itv.it_value.tv_sec = 1;
@@ -630,7 +630,7 @@ test_simplesignal(void)
 
        event_dispatch();
  skip_simplesignal:
-       if (signal_del(&ev) == -1)
+       if (evsignal_del(&ev) == -1)
                test_ok = 0;
 
        cleanup_test();
@@ -644,11 +644,11 @@ test_multiplesignal(void)
 
        setup_test("Multiple signal: ");
 
-       signal_set(&ev_one, SIGALRM, signal_cb, &ev_one);
-       signal_add(&ev_one, NULL);
+       evsignal_set(&ev_one, SIGALRM, signal_cb, &ev_one);
+       evsignal_add(&ev_one, NULL);
 
-       signal_set(&ev_two, SIGALRM, signal_cb, &ev_two);
-       signal_add(&ev_two, NULL);
+       evsignal_set(&ev_two, SIGALRM, signal_cb, &ev_two);
+       evsignal_add(&ev_two, NULL);
 
        memset(&itv, 0, sizeof(itv));
        itv.it_value.tv_sec = 1;
@@ -658,9 +658,9 @@ test_multiplesignal(void)
        event_dispatch();
 
  skip_simplesignal:
-       if (signal_del(&ev_one) == -1)
+       if (evsignal_del(&ev_one) == -1)
                test_ok = 0;
-       if (signal_del(&ev_two) == -1)
+       if (evsignal_del(&ev_two) == -1)
                test_ok = 0;
 
        cleanup_test();
@@ -673,24 +673,24 @@ test_immediatesignal(void)
 
        test_ok = 0;
        printf("Immediate signal: ");
-       signal_set(&ev, SIGUSR1, signal_cb, &ev);
-       signal_add(&ev, NULL);
+       evsignal_set(&ev, SIGUSR1, signal_cb, &ev);
+       evsignal_add(&ev, NULL);
        raise(SIGUSR1);
        event_loop(EVLOOP_NONBLOCK);
-       signal_del(&ev);
+       evsignal_del(&ev);
        cleanup_test();
 }
 
 static void
 test_signal_dealloc(void)
 {
-       /* make sure that signal_event is event_del'ed and pipe closed */
+       /* make sure that evsignal_event is event_del'ed and pipe closed */
        struct event ev;
        struct event_base *base = event_init();
        printf("Signal dealloc: ");
-       signal_set(&ev, SIGUSR1, signal_cb, &ev);
-       signal_add(&ev, NULL);
-       signal_del(&ev);
+       evsignal_set(&ev, SIGUSR1, signal_cb, &ev);
+       evsignal_add(&ev, NULL);
+       evsignal_del(&ev);
        event_base_free(base);
         /* If we got here without asserting, we're fine. */
         test_ok = 1;
@@ -736,8 +736,8 @@ test_signal_switchbase(void)
        base1 = event_init();
        base2 = event_init();
         is_kqueue = !strcmp(event_get_method(),"kqueue");
-       signal_set(&ev1, SIGUSR1, signal_cb, &ev1);
-       signal_set(&ev2, SIGUSR1, signal_cb, &ev2);
+       evsignal_set(&ev1, SIGUSR1, signal_cb, &ev1);
+       evsignal_set(&ev2, SIGUSR1, signal_cb, &ev2);
        if (event_base_set(base1, &ev1) ||
            event_base_set(base2, &ev2) ||
            event_add(&ev1, NULL) ||
@@ -783,17 +783,17 @@ test_signal_assert(void)
        test_ok = 0;
        printf("Signal handler assert: ");
        /* use SIGCONT so we don't kill ourselves when we signal to nowhere */
-       signal_set(&ev, SIGCONT, signal_cb, &ev);
-       signal_add(&ev, NULL);
+       evsignal_set(&ev, SIGCONT, signal_cb, &ev);
+       evsignal_add(&ev, NULL);
        /*
-        * if signal_del() fails to reset the handler, it's current handler
-        * will still point to evsignal_handler().
+        * if evsignal_del() fails to reset the handler, it's current handler
+        * will still point to evsig_handler().
         */
-       signal_del(&ev);
+       evsignal_del(&ev);
 
        raise(SIGCONT);
-       /* only way to verify we were in evsignal_handler() */
-       if (base->sig.evsignal_caught)
+       /* only way to verify we were in evsig_handler() */
+       if (base->sig.evsig_caught)
                test_ok = 0;
        else
                test_ok = 1;
@@ -827,9 +827,9 @@ test_signal_restore(void)
        if (signal(SIGUSR1, signal_cb_sa) == SIG_ERR)
                goto out;
 #endif
-       signal_set(&ev, SIGUSR1, signal_cb, &ev);
-       signal_add(&ev, NULL);
-       signal_del(&ev);
+       evsignal_set(&ev, SIGUSR1, signal_cb, &ev);
+       evsignal_add(&ev, NULL);
+       evsignal_del(&ev);
 
        raise(SIGUSR1);
        /* 1 == signal_cb, 2 == signal_cb_sa, we want our previous handler */