Git fork

compat/mingw: allow sigaction(SIGCHLD)

A future change will start using sigaction to setup a SIGCHLD signal
handler.

The current code uses signal(), which returns SIG_ERR (but doesn't
seem to set errno) so instruct sigaction() to do the same.

A new SA flag will be needed, so copy the one from Cygwin; note that
the sigaction() implementation that is provided won't use it, so
its value is otherwise irrelevant.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Carlo Marcelo Arenas Belón and committed by
Junio C Hamano
ef03aa43 cb3b4038

+4 -1
+1
compat/mingw-posix.h
··· 96 96 unsigned sa_flags; 97 97 }; 98 98 #define SA_RESTART 0 99 + #define SA_NOCLDSTOP 1 99 100 100 101 struct itimerval { 101 102 struct timeval it_value, it_interval;
+3 -1
compat/mingw.c
··· 2561 2561 2562 2562 int sigaction(int sig, struct sigaction *in, struct sigaction *out) 2563 2563 { 2564 - if (sig != SIGALRM) 2564 + if (sig == SIGCHLD) 2565 + return -1; 2566 + else if (sig != SIGALRM) 2565 2567 return errno = EINVAL, 2566 2568 error("sigaction only implemented for SIGALRM"); 2567 2569 if (out)