michael@0: diff --git a/ipc/chromium/src/third_party/libevent/kqueue.c b/ipc/chromium/src/third_party/libevent/kqueue.c michael@0: --- a/ipc/chromium/src/third_party/libevent/kqueue.c michael@0: +++ b/ipc/chromium/src/third_party/libevent/kqueue.c michael@0: @@ -158,26 +158,20 @@ kq_init(struct event_base *base) michael@0: base->evsigsel = &kqsigops; michael@0: michael@0: return (kqueueop); michael@0: err: michael@0: if (kqueueop) michael@0: kqop_free(kqueueop); michael@0: michael@0: return (NULL); michael@0: } michael@0: michael@0: -static void michael@0: -kq_sighandler(int sig) michael@0: -{ michael@0: - /* Do nothing here */ michael@0: -} michael@0: - michael@0: #define ADD_UDATA 0x30303 michael@0: michael@0: static void michael@0: kq_setup_kevent(struct kevent *out, evutil_socket_t fd, int filter, short change) michael@0: { michael@0: memset(out, 0, sizeof(struct kevent)); michael@0: out->ident = fd; michael@0: out->filter = filter; michael@0: michael@0: if (change & EV_CHANGE_ADD) { michael@0: @@ -431,24 +425,31 @@ kq_sig_add(struct event_base *base, int michael@0: kev.ident = nsignal; michael@0: kev.filter = EVFILT_SIGNAL; michael@0: kev.flags = EV_ADD; michael@0: michael@0: /* Be ready for the signal if it is sent any michael@0: * time between now and the next call to michael@0: * kq_dispatch. */ michael@0: if (kevent(kqop->kq, &kev, 1, NULL, 0, &timeout) == -1) michael@0: return (-1); michael@0: michael@0: - /* XXXX The manpage suggest we could use SIG_IGN instead of a michael@0: - * do-nothing handler */ michael@0: - if (_evsig_set_handler(base, nsignal, kq_sighandler) == -1) michael@0: + /* Backported from michael@0: + * https://github.com/nmathewson/Libevent/commit/148458e0a1fd25e167aa2ef229d1c9a70b27c3e9 */ michael@0: + /* We can set the handler for most signals to SIG_IGN and michael@0: + * still have them reported to us in the queue. However, michael@0: + * if the handler for SIGCHLD is SIG_IGN, the system reaps michael@0: + * zombie processes for us, and we don't get any notification. michael@0: + * This appears to be the only signal with this quirk. */ michael@0: + if (_evsig_set_handler(base, nsignal, michael@0: + nsignal == SIGCHLD ? SIG_DFL : SIG_IGN) == -1) { michael@0: return (-1); michael@0: + } michael@0: michael@0: return (0); michael@0: } michael@0: michael@0: static int michael@0: kq_sig_del(struct event_base *base, int nsignal, short old, short events, void *p) michael@0: { michael@0: struct kqop *kqop = base->evbase; michael@0: struct kevent kev; michael@0: