Skip to content

Commit 6186021

Browse files
vstinnercollinfunk
andauthored
[3.12] gh-129539: Include sysexits.h before checking EX_OK (#129590) (#129609)
[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 65f3432) Co-authored-by: Collin Funk <collin.funk1@gmail.com>
1 parent eff45c9 commit 6186021

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Don't redefine ``EX_OK`` when the system has the ``sysexits.h`` header.

Modules/posixmodule.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,6 @@
4949
# include "winreparse.h"
5050
#endif
5151

52-
#if !defined(EX_OK) && defined(EXIT_SUCCESS)
53-
# define EX_OK EXIT_SUCCESS
54-
#endif
55-
5652
/* On android API level 21, 'AT_EACCESS' is not declared although
5753
* HAVE_FACCESSAT is defined. */
5854
#ifdef __ANDROID__
@@ -270,6 +266,10 @@ corresponding Unix manual entries for more information on calls.");
270266
# include <sysexits.h>
271267
#endif
272268

269+
#if !defined(EX_OK) && defined(EXIT_SUCCESS)
270+
# define EX_OK EXIT_SUCCESS
271+
#endif
272+
273273
#ifdef HAVE_SYS_LOADAVG_H
274274
# include <sys/loadavg.h>
275275
#endif

0 commit comments

Comments
 (0)