mingw.h: add dummy functions for sigset_t operations
authorJohannes Sixt <j6t@kdbg.org>
Mon, 22 Sep 2014 18:24:34 +0000 (20:24 +0200)
committerJunio C Hamano <gitster@pobox.com>
Mon, 22 Sep 2014 20:41:52 +0000 (13:41 -0700)
Windows does not have POSIX-like signals, and so we ignore all
operations on the non-existent signal mask machinery.

Do not turn sigemptyset into a function, but leave it a macro that
erases the code in the argument because it is used to set sa_mask
of a struct sigaction, but our dummy in mingw.h does not have that
member.

Signed-off-by: Johannes Sixt <j6t@kdbg.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/mingw.h
t/t0005-signals.sh
index df0e3203abed06374a789be191ff130e3ba728b6..5e499cfb71a00ea81013c1ed21e9a5e9dc9e2544 100644 (file)
@@ -69,7 +69,6 @@ struct sigaction {
        sig_handler_t sa_handler;
        unsigned sa_flags;
 };
-#define sigemptyset(x) (void)0
 #define SA_RESTART 0
 
 struct itimerval {
@@ -116,6 +115,12 @@ static inline int fcntl(int fd, int cmd, ...)
 }
 /* bash cannot reliably detect negative return codes as failure */
 #define exit(code) exit((code) & 0xff)
+#define sigemptyset(x) (void)0
+static inline int sigaddset(sigset_t *set, int signum)
+{ return 0; }
+#define SIG_UNBLOCK 0
+static inline int sigprocmask(int how, const sigset_t *set, sigset_t *oldset)
+{ return 0; }
 
 /*
  * simple adaptors
index 638a35590621cb4058a21bb180423cbb2a24403e..aeea50c6339ebd4a0d33ce03b7fad5948e69a8a8 100755 (executable)
@@ -39,12 +39,12 @@ test_expect_success 'create blob' '
        git add file
 '
 
-test_expect_success 'a constipated git dies with SIGPIPE' '
+test_expect_success !MINGW 'a constipated git dies with SIGPIPE' '
        OUT=$( ((large_git; echo $? 1>&3) | :) 3>&1 )
        test "$OUT" -eq 141
 '
 
-test_expect_success 'a constipated git dies with SIGPIPE even if parent ignores it' '
+test_expect_success !MINGW 'a constipated git dies with SIGPIPE even if parent ignores it' '
        OUT=$( ((trap "" PIPE; large_git; echo $? 1>&3) | :) 3>&1 )
        test "$OUT" -eq 141
 '