aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKen Brown2019-06-29 15:03:34 -0400
committerKen Brown2019-06-29 15:03:34 -0400
commit0b2841f9fb0ffd8514b0fb99c5673adad6b07abb (patch)
tree7ffe55bddf7d528262980d3737624d6760a9c3f5
parent74a5a332fee8a346cf65ed6656c1b08dc1df5fde (diff)
downloademacs-0b2841f9fb0ffd8514b0fb99c5673adad6b07abb.tar.gz
emacs-0b2841f9fb0ffd8514b0fb99c5673adad6b07abb.zip
Simplify workaround for Cygwin O_PATH bug
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.
-rw-r--r--configure.ac3
-rw-r--r--src/dired.c6
2 files changed, 4 insertions, 5 deletions
diff --git a/configure.ac b/configure.ac
index 8ff0e21fbf6..774f8e5eb92 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5734,6 +5734,9 @@ case $opsys,$emacs_uname_r in
5734 AC_MSG_WARN([[building Emacs on Cygwin 1.5 is not supported.]]) 5734 AC_MSG_WARN([[building Emacs on Cygwin 1.5 is not supported.]])
5735 echo 5735 echo
5736 ;; 5736 ;;
5737 cygwin,3.0.[[0-7]]'('*)
5738 AC_DEFINE([HAVE_CYGWIN_O_PATH_BUG], 1,
5739 [Define to 1 if opening a FIFO with O_PATH causes a hang.]);;
5737esac 5740esac
5738 5741
5739# Remove any trailing slashes in these variables. 5742# Remove any trailing slashes in these variables.
diff --git a/src/dired.c b/src/dired.c
index b8197d36a02..b700013f6a8 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -41,10 +41,6 @@ along with GNU Emacs. If not, see <https://www.gnu.org/licenses/>. */
41#include "buffer.h" 41#include "buffer.h"
42#include "coding.h" 42#include "coding.h"
43 43
44#ifdef __CYGWIN__
45# undef O_PATH /* Buggy in Cygwin 3.0.0 through 3.0.7. */
46#endif
47
48#ifdef MSDOS 44#ifdef MSDOS
49#include "msdos.h" /* for fstatat */ 45#include "msdos.h" /* for fstatat */
50#endif 46#endif
@@ -941,7 +937,7 @@ file_attributes (int fd, char const *name,
941 937
942 int err = EINVAL; 938 int err = EINVAL;
943 939
944#ifdef O_PATH 940#if defined O_PATH && !defined HAVE_CYGWIN_O_PATH_BUG
945 int namefd = openat (fd, name, O_PATH | O_CLOEXEC | O_NOFOLLOW); 941 int namefd = openat (fd, name, O_PATH | O_CLOEXEC | O_NOFOLLOW);
946 if (namefd < 0) 942 if (namefd < 0)
947 err = errno; 943 err = errno;