]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-129539: Include sysexits.h before checking EX_OK (#129590) (#129609)
authorVictor Stinner <vstinner@python.org>
Mon, 3 Feb 2025 12:00:10 +0000 (13:00 +0100)
committerGitHub <noreply@github.com>
Mon, 3 Feb 2025 12:00:10 +0000 (12:00 +0000)
[3.13] gh-129539: Include sysexits.h before checking EX_OK (#129590)

Previously, the macro would be redefined when the header was included.

(cherry picked from commit 65f3432ac32f92bc3d8b7b11103a56c5a70049c0)

Co-authored-by: Collin Funk <collin.funk1@gmail.com>
Misc/NEWS.d/next/Build/2025-02-02-09-11-45.gh-issue-129539.SYXXCg.rst [new file with mode: 0644]
Modules/posixmodule.c

diff --git a/Misc/NEWS.d/next/Build/2025-02-02-09-11-45.gh-issue-129539.SYXXCg.rst b/Misc/NEWS.d/next/Build/2025-02-02-09-11-45.gh-issue-129539.SYXXCg.rst
new file mode 100644 (file)
index 0000000..9781dc0
--- /dev/null
@@ -0,0 +1 @@
+Don't redefine ``EX_OK`` when the system has the ``sysexits.h`` header.
index c386f15b1714e1335e12573ceca7a78fefc098db..c21c6f06c729de2ac1a4598180a394261c86e53b 100644 (file)
 #  include "winreparse.h"
 #endif
 
-#if !defined(EX_OK) && defined(EXIT_SUCCESS)
-#  define EX_OK EXIT_SUCCESS
-#endif
-
 /* On android API level 21, 'AT_EACCESS' is not declared although
  * HAVE_FACCESSAT is defined. */
 #ifdef __ANDROID__
@@ -270,6 +266,10 @@ corresponding Unix manual entries for more information on calls.");
 #  include <sysexits.h>
 #endif
 
+#if !defined(EX_OK) && defined(EXIT_SUCCESS)
+#  define EX_OK EXIT_SUCCESS
+#endif
+
 #ifdef HAVE_SYS_LOADAVG_H
 #  include <sys/loadavg.h>
 #endif