Skip to content

Commit a454065

Browse files
kusmagitster
authored andcommitted
mingw: make mingw_signal return the correct handler
Returning the SIGALRM handler for SIGINT is not very useful. Signed-off-by: Erik Faye-Lund <[email protected]> Signed-off-by: Johannes Sixt <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent b1c418e commit a454065

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

compat/mingw.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1677,14 +1677,16 @@ int sigaction(int sig, struct sigaction *in, struct sigaction *out)
16771677
#undef signal
16781678
sig_handler_t mingw_signal(int sig, sig_handler_t handler)
16791679
{
1680-
sig_handler_t old = timer_fn;
1680+
sig_handler_t old;
16811681

16821682
switch (sig) {
16831683
case SIGALRM:
1684+
old = timer_fn;
16841685
timer_fn = handler;
16851686
break;
16861687

16871688
case SIGINT:
1689+
old = sigint_fn;
16881690
sigint_fn = handler;
16891691
break;
16901692

0 commit comments

Comments
 (0)