Skip to content

Commit

Permalink
gh-129539: Include sysexits.h before checking EX_OK
Browse files Browse the repository at this point in the history
Previously the macro would be redefined when the header was included.
  • Loading branch information
collinfunk committed Feb 1, 2025
1 parent d89a5f6 commit 4d1df0d
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 5 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Don't redefine ``EX_OK`` when the system has the ``sysexits.h`` header.
10 changes: 5 additions & 5 deletions Modules/posixmodule.c
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,6 @@
# include "winreparse.h"
#endif

#if !defined(EX_OK) && defined(EXIT_SUCCESS)
# define EX_OK EXIT_SUCCESS
#endif

#ifdef __APPLE__
/* Needed for the implementation of os.statvfs */
# include <sys/param.h>
Expand Down Expand Up @@ -292,7 +288,11 @@ corresponding Unix manual entries for more information on calls.");
#endif

#ifdef HAVE_SYSEXITS_H
# include <sysexits.h>
# include <sysexits.h> // EX_OK
#endif

#if !defined(EX_OK) && defined(EXIT_SUCCESS)
# define EX_OK EXIT_SUCCESS
#endif

#ifdef HAVE_SYS_LOADAVG_H
Expand Down

0 comments on commit 4d1df0d

Please sign in to comment.