emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 0b2841f: Simplify workaround for Cygwin O_PATH bug


From: Ken Brown
Subject: [Emacs-diffs] master 0b2841f: Simplify workaround for Cygwin O_PATH bug
Date: Sat, 29 Jun 2019 15:05:27 -0400 (EDT)

branch: master
commit 0b2841f9fb0ffd8514b0fb99c5673adad6b07abb
Author: Ken Brown <address@hidden>
Commit: Ken Brown <address@hidden>

    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.
---
 configure.ac | 3 +++
 src/dired.c  | 6 +-----
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/configure.ac b/configure.ac
index 8ff0e21..774f8e5 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5734,6 +5734,9 @@ case $opsys,$emacs_uname_r in
     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.
diff --git a/src/dired.c b/src/dired.c
index b8197d3..b700013 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/>.  */
 #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
@@ -941,7 +937,7 @@ file_attributes (int fd, char const *name,
 
   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;



reply via email to

[Prev in Thread] Current Thread [Next in Thread]