diff options
author | Dmitry Antipov <dantipov@cloudlinux.com> | 2022-10-25 11:30:34 +0300 |
---|---|---|
committer | Azat Khuzhin <azat@libevent.org> | 2022-11-12 21:14:48 +0100 |
commit | 1af745d033678333752afcd8724f5d6351561b4e (patch) | |
tree | b67297abda6067ca1609c338f74bbcc07332730a /evmap.c | |
parent | 9e346936d47a3a461f8ebaedabb2975bef3babf5 (diff) | |
download | libevent-1af745d033678333752afcd8724f5d6351561b4e.tar.gz |
signal: new signal handling backend based on signalfd
Linux-specific signal handling backend based on signalfd(2)
system call, and public function event_base_get_signal_method()
to obtain an underlying kernel signal handling mechanism.
Signed-off-by: Dmitry Antipov <dantipov@cloudlinux.com>
Diffstat (limited to 'evmap.c')
-rw-r--r-- | evmap.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -465,7 +465,7 @@ evmap_signal_add_(struct event_base *base, int sig, struct event *ev) base->evsigsel->fdinfo_len); if (LIST_EMPTY(&ctx->events)) { - if (evsel->add(base, ev->ev_fd, 0, EV_SIGNAL, NULL) + if (evsel->add(base, ev->ev_fd, 0, EV_SIGNAL, ev) == -1) return (-1); } @@ -643,7 +643,8 @@ evmap_signal_reinit_iter_fn(struct event_base *base, int *result = arg; if (!LIST_EMPTY(&ctx->events)) { - if (evsel->add(base, signum, 0, EV_SIGNAL, NULL) == -1) + if (evsel->add(base, signum, 1, EV_SIGNAL, + LIST_FIRST(&ctx->events)) == -1) *result = -1; } return 0; |