Windows: add pthread_sigmask() that does nothing
authorJohannes Sixt <j6t@kdbg.org>
Sun, 1 May 2016 19:08:21 +0000 (21:08 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 2 May 2016 18:22:24 +0000 (11:22 -0700)
A previous change introduced a call to pthread_sigmask() in order to block
SIGPIPE in a thread. Since there are no signal facilities on Windows that
are similar to POSIX signals, just ignore the request to block the signal.
In the particular case, the effect of blocking SIGPIPE on POSIX is that
write() calls return EPIPE when the reader closes the pipe. This is how
write() behaves on Windows.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.h
compat/win32/pthread.h
index a5fb52f97750f4b7560fe846c2d1c9d02915faf2..c26b6e2958c456647e96d98bfd79275417cc3e14 100644 (file)
@@ -124,6 +124,7 @@ static inline int fcntl(int fd, int cmd, ...)
 #define sigemptyset(x) (void)0
 static inline int sigaddset(sigset_t *set, int signum)
 { return 0; }
+#define SIG_BLOCK 0
 #define SIG_UNBLOCK 0
 static inline int sigprocmask(int how, const sigset_t *set, sigset_t *oldset)
 { return 0; }
index 8ad187344fd93e894a2f1cbfaa0fb59fd832de5b..e74157cd4d04d304b96fe88a70804b240f798b1c 100644 (file)
@@ -101,4 +101,9 @@ static inline void *pthread_getspecific(pthread_key_t key)
        return TlsGetValue(key);
 }
 
+static inline int pthread_sigmask(int how, const sigset_t *set, sigset_t *oset)
+{
+       return 0;
+}
+
 #endif /* PTHREAD_H */