git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Johannes Sixt <j6t@kdbg.org>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Jeff King <peff@peff.net>,
	git-for-windows <git-for-windows@googlegroups.com>,
	Git Mailing List <git@vger.kernel.org>
Subject: [PATCH jk/push-client-deadlock-fix] Windows: add pthread_sigmask() that does nothing
Date: Sun, 1 May 2016 21:08:21 +0200	[thread overview]
Message-ID: <57265425.9050205@kdbg.org> (raw)
In-Reply-To: <20160501174535.GB17321@sigill.intra.peff.net>

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>
---
 compat/mingw.h         | 1 +
 compat/win32/pthread.h | 5 +++++
 2 files changed, 6 insertions(+)

diff --git a/compat/mingw.h b/compat/mingw.h
index a950ae2..0f272fd 100644
--- a/compat/mingw.h
+++ b/compat/mingw.h
@@ -142,6 +142,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; }
diff --git a/compat/win32/pthread.h b/compat/win32/pthread.h
index b6ed9e7..d336451 100644
--- a/compat/win32/pthread.h
+++ b/compat/win32/pthread.h
@@ -104,4 +104,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 */
-- 
2.7.0.118.g90056ae

  reply	other threads:[~2016-05-01 19:08 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-05-01 11:06 pthread_sigmask() on windows (wine actualy) Duy Nguyen
2016-05-01 17:45 ` Jeff King
2016-05-01 19:08   ` Johannes Sixt [this message]
2016-05-03  4:48     ` [PATCH jk/push-client-deadlock-fix] Windows: add pthread_sigmask() that does nothing Jeff King

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=57265425.9050205@kdbg.org \
    --to=j6t@kdbg.org \
    --cc=git-for-windows@googlegroups.com \
    --cc=git@vger.kernel.org \
    --cc=pclouds@gmail.com \
    --cc=peff@peff.net \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).