Suggested by Paul Eggert (Bug#36405#22).
* configure.ac (HAVE_CYGWIN_O_PATH_BUG): New AC_DEFINE, for Cygwin
versions 3.0.0 through 3.0.7.
* src/dired.c (O_PATH) [__CYGWIN__]: Remove #undef.
(file_attributes) [HAVE_CYGWIN_O_PATH_BUG]: Don't use O_PATH.
AC_MSG_WARN([[building Emacs on Cygwin 1.5 is not supported.]])
echo
;;
+ cygwin,3.0.[[0-7]]'('*)
+ AC_DEFINE([HAVE_CYGWIN_O_PATH_BUG], 1,
+ [Define to 1 if opening a FIFO with O_PATH causes a hang.]);;
esac
# Remove any trailing slashes in these variables.
#include "buffer.h"
#include "coding.h"
-#ifdef __CYGWIN__
-# undef O_PATH /* Buggy in Cygwin 3.0.0 through 3.0.7. */
-#endif
-
#ifdef MSDOS
#include "msdos.h" /* for fstatat */
#endif
int err = EINVAL;
-#ifdef O_PATH
+#if defined O_PATH && !defined HAVE_CYGWIN_O_PATH_BUG
int namefd = openat (fd, name, O_PATH | O_CLOEXEC | O_NOFOLLOW);
if (namefd < 0)
err = errno;