mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
[Bug #21128] Include fcntl.h before checking for O_CLOEXEC
On glibc O_CLOEXEC is defined in fcntl.h and not unistd.h so this change prevents the macro from being redefined.
This commit is contained in:
parent
c8f4df4ae9
commit
c1c7934b63
Notes:
git
2025-02-17 04:05:35 +00:00
1 changed files with 6 additions and 6 deletions
12
dir.c
12
dir.c
|
@ -22,10 +22,6 @@
|
||||||
#include <unistd.h>
|
#include <unistd.h>
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#ifndef O_CLOEXEC
|
|
||||||
# define O_CLOEXEC 0
|
|
||||||
#endif
|
|
||||||
|
|
||||||
#ifndef USE_OPENDIR_AT
|
#ifndef USE_OPENDIR_AT
|
||||||
# if defined(HAVE_FDOPENDIR) && defined(HAVE_DIRFD) && \
|
# if defined(HAVE_FDOPENDIR) && defined(HAVE_DIRFD) && \
|
||||||
defined(HAVE_OPENAT) && defined(HAVE_FSTATAT)
|
defined(HAVE_OPENAT) && defined(HAVE_FSTATAT)
|
||||||
|
@ -35,8 +31,12 @@
|
||||||
# endif
|
# endif
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#if USE_OPENDIR_AT
|
#ifdef HAVE_FCNTL_H
|
||||||
# include <fcntl.h>
|
# include <fcntl.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
|
#ifndef O_CLOEXEC
|
||||||
|
# define O_CLOEXEC 0
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
#undef HAVE_DIRENT_NAMLEN
|
#undef HAVE_DIRENT_NAMLEN
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue