Skip to content

Commit 4d1df0d

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

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
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: 5 additions & 5 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,7 +288,11 @@ corresponding Unix manual entries for more information on calls.");
292288
#endif
293289

294290
#ifdef HAVE_SYSEXITS_H
295-
# include <sysexits.h>
291+
# include <sysexits.h> // EX_OK
292+
#endif
293+
294+
#if !defined(EX_OK) && defined(EXIT_SUCCESS)
295+
# define EX_OK EXIT_SUCCESS
296296
#endif
297297

298298
#ifdef HAVE_SYS_LOADAVG_H

0 commit comments

Comments
 (0)