Skip to content

Commit ef40eea

Browse files
committed
gh-129539: Include sysexits.h before checking EX_OK
Previously the macro would be redefined when the header was included.
1 parent d89a5f6 commit ef40eea

File tree

2 files changed

+5
-4
lines changed

2 files changed

+5
-4
lines changed
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

+4-4
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,6 @@
5252
# include "winreparse.h"
5353
#endif
5454

55-
#if !defined(EX_OK) && defined(EXIT_SUCCESS)
56-
# define EX_OK EXIT_SUCCESS
57-
#endif
58-
5955
#ifdef __APPLE__
6056
/* Needed for the implementation of os.statvfs */
6157
# include <sys/param.h>
@@ -295,6 +291,10 @@ corresponding Unix manual entries for more information on calls.");
295291
# include <sysexits.h>
296292
#endif
297293

294+
#if !defined(EX_OK) && defined(EXIT_SUCCESS)
295+
# define EX_OK EXIT_SUCCESS
296+
#endif
297+
298298
#ifdef HAVE_SYS_LOADAVG_H
299299
# include <sys/loadavg.h>
300300
#endif

0 commit comments

Comments
 (0)