Skip to content

Commit 95dbc8c

Browse files
committed
eloop: Apply inner signal kqueue logic to non kqueue
1 parent 91d6d3a commit 95dbc8c

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

src/eloop.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1056,6 +1056,16 @@ eloop_start(struct eloop *eloop)
10561056

10571057
#ifndef USE_KQUEUE
10581058
if (eloop_nsig != 0) {
1059+
/* Inner loops generally don't have signals attached
1060+
* but we do need to exit the loop to when interrupted
1061+
* with SIGTERM or SIGINT. */
1062+
if (eloop->signal_cb == NULL) {
1063+
eloop_exit(eloop,
1064+
eloop_sig[eloop_nsig - 1] == SIGTERM ?
1065+
EXIT_SUCCESS :
1066+
EXIT_FAILURE);
1067+
return 0;
1068+
}
10591069
int n = eloop_sig[--eloop_nsig];
10601070

10611071
if (eloop->signal_cb != NULL)

0 commit comments

Comments
 (0)