]> Savannah Git Hosting - gnulib.git/commitdiff
spawn: Fix compilation error on macOS (regression 2023-01-22).
authorBruno Haible <bruno@clisp.org>
Sat, 4 Feb 2023 07:43:50 +0000 (08:43 +0100)
committerBruno Haible <bruno@clisp.org>
Sat, 4 Feb 2023 07:43:50 +0000 (08:43 +0100)
* lib/spawn.in.h: Tweak logic for defining the POSIX_SPAWN_* constants.

ChangeLog
lib/spawn.in.h

index 62010f67e666a999c3761ba33cbd1fca9065f20a..fe9bdb27a0f3ecbeeac17f2fb7cc3cfc02d964ea 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2023-02-04  Bruno Haible  <bruno@clisp.org>
+
+       spawn: Fix compilation error on macOS (regression 2023-01-22).
+       * lib/spawn.in.h: Tweak logic for defining the POSIX_SPAWN_* constants.
+
 2023-02-03  Bruno Haible  <bruno@clisp.org>
 
        relocatable-prog: Fix compiler warning.
index 958464a7d236b46d652228621e1fa0a4d61a87c7..b35e5d77b326c3abcddcad80540fb75d4b334b75 100644 (file)
@@ -144,19 +144,18 @@ typedef struct
 
 /* Flags to be set in the 'posix_spawnattr_t'.  */
 #if @HAVE_POSIX_SPAWN@
-# if !@REPLACE_POSIX_SPAWN@
-/* Use the values from the system, but provide the missing ones.  */
-#  ifndef POSIX_SPAWN_SETSCHEDPARAM
-#   define POSIX_SPAWN_SETSCHEDPARAM 0
-#  endif
-#  ifndef POSIX_SPAWN_SETSCHEDULER
-#   define POSIX_SPAWN_SETSCHEDULER 0
-#  endif
-# else /* @REPLACE_POSIX_SPAWN@ */
+# if @REPLACE_POSIX_SPAWN@
 /* Use the values from the system, for better compatibility.  */
 /* But this implementation does not support AIX extensions.  */
 #   undef POSIX_SPAWN_FORK_HANDLERS
 # endif
+/* Provide the values that the system is lacking.  */
+# ifndef POSIX_SPAWN_SETSCHEDPARAM
+#  define POSIX_SPAWN_SETSCHEDPARAM 0
+# endif
+# ifndef POSIX_SPAWN_SETSCHEDULER
+#  define POSIX_SPAWN_SETSCHEDULER 0
+# endif
 #else /* !@HAVE_POSIX_SPAWN@ */
 # define POSIX_SPAWN_RESETIDS           0x01
 # define POSIX_SPAWN_SETPGROUP          0x02