Skip to content

Commit f924b52

Browse files
j6tgitster
authored andcommitted
Windows: add pthread_sigmask() that does nothing
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent c4b2751 commit f924b52

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed

compat/mingw.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ static inline int fcntl(int fd, int cmd, ...)
124124
#define sigemptyset(x) (void)0
125125
static inline int sigaddset(sigset_t *set, int signum)
126126
{ return 0; }
127+
#define SIG_BLOCK 0
127128
#define SIG_UNBLOCK 0
128129
static inline int sigprocmask(int how, const sigset_t *set, sigset_t *oldset)
129130
{ return 0; }

compat/win32/pthread.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -101,4 +101,9 @@ static inline void *pthread_getspecific(pthread_key_t key)
101101
return TlsGetValue(key);
102102
}
103103

104+
static inline int pthread_sigmask(int how, const sigset_t *set, sigset_t *oset)
105+
{
106+
return 0;
107+
}
108+
104109
#endif /* PTHREAD_H */

0 commit comments

Comments
 (0)