]> git.ipfire.org Git - thirdparty/git.git/commitdiff
compat/posix.h: track SA_RESTART fallback
authorCarlo Marcelo Arenas Belón <carenas@gmail.com>
Tue, 24 Jun 2025 14:08:40 +0000 (14:08 +0000)
committerJunio C Hamano <gitster@pobox.com>
Tue, 24 Jun 2025 16:15:57 +0000 (09:15 -0700)
Systems without SA_RESTART where using custom CFLAGS instead of
the standard header file.

Consolidate that, so it will be easier to use in a future commit.

Signed-off-by: Carlo Marcelo Arenas Belón <carenas@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
compat/posix.h
config.mak.uname

index 067a00f33b83f31ffabff5045c9bda1a9059dda2..2612a8515897eb9f3404c7007ddeed198add28ce 100644 (file)
@@ -250,6 +250,13 @@ char *gitdirname(char *);
 #define NAME_MAX 255
 #endif
 
+/* On most systems <signal.h> would have given us this, but
+ * not on some systems (e.g. NonStop, QNX).
+ */
+#ifndef SA_RESTART
+#define SA_RESTART 0   /* disabled for sigaction() */
+#endif
+
 typedef uintmax_t timestamp_t;
 #define PRItime PRIuMAX
 #define parse_timestamp strtoumax
index b1c5c4d5e8edd16b790fbc6d75b422eceda066ba..52160ef5cb07082a62536ea852ffb4c4188d6da9 100644 (file)
@@ -654,8 +654,6 @@ ifeq ($(uname_S),NONSTOP_KERNEL)
        FREAD_READS_DIRECTORIES = UnfortunatelyYes
 
        # Not detected (nor checked for) by './configure'.
-       # We don't have SA_RESTART on NonStop, unfortunalety.
-       COMPAT_CFLAGS += -DSA_RESTART=0
        # Apparently needed in compat/fnmatch/fnmatch.c.
        COMPAT_CFLAGS += -DHAVE_STRING_H=1
        NO_ST_BLOCKS_IN_STRUCT_STAT = YesPlease
@@ -782,7 +780,6 @@ ifeq ($(uname_S),MINGW)
         endif
 endif
 ifeq ($(uname_S),QNX)
-       COMPAT_CFLAGS += -DSA_RESTART=0
        EXPAT_NEEDS_XMLPARSE_H = YesPlease
        HAVE_STRINGS_H = YesPlease
        NEEDS_SOCKET = YesPlease