Skip to content

Commit 65f3432

Browse files
authored
[3.13] gh-129539: Include sysexits.h before checking EX_OK (#129590)
Previously, the macro would be redefined when the header was included.
1 parent 63cae73 commit 65f3432

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
@@ -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>
@@ -292,6 +288,10 @@ corresponding Unix manual entries for more information on calls.");
292288
# include <sysexits.h>
293289
#endif
294290

291+
#if !defined(EX_OK) && defined(EXIT_SUCCESS)
292+
# define EX_OK EXIT_SUCCESS
293+
#endif
294+
295295
#ifdef HAVE_SYS_LOADAVG_H
296296
# include <sys/loadavg.h>
297297
#endif

0 commit comments

Comments
 (0)