all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Paul Eggert <eggert@cs.ucla.edu>
To: Eli Zaretskii <eliz@gnu.org>
Cc: 36405@debbugs.gnu.org
Subject: bug#36405: 26.2.90; O_PATH problem on some versions of Cygwin
Date: Fri, 28 Jun 2019 23:26:09 -0700	[thread overview]
Message-ID: <cd1ada3b-c764-e2bd-d3ac-4b87000b5250@cs.ucla.edu> (raw)
In-Reply-To: <83k1d6i5vl.fsf@gnu.org>

[-- Attachment #1: Type: text/plain, Size: 634 bytes --]

Eli Zaretskii wrote:
> What problems did you see/envision on other platforms with the
> original patch?

Mainly the hassle of maintaining code with a lot of hard-to-read ifdefs in it. 
It's better if system-specific stuff is kept to a minimum in mainline code. 
Also, this O_PATH stuff is not that high of a priority, as the code works quite 
well in practice without O_PATH. (Also, if Cygwin botched O_PATH on FIFOs 
there's a reasonable chance it botched O_PATH elsewhere too. :-)

How about something like the attached patch instead? It's simpler and should be 
a bit faster on Cygwin than the original patch. I haven't tested it.

[-- Attachment #2: cygwin.diff --]
[-- Type: text/x-patch, Size: 1023 bytes --]

diff --git a/configure.ac b/configure.ac
index 8ff0e21fbf..a0e99ac393 100644
--- a/configure.ac
+++ b/configure.ac
@@ -5734,6 +5734,9 @@ AC_DEFUN
     AC_MSG_WARN([[building Emacs on Cygwin 1.5 is not supported.]])
            echo
 	   ;;
+  cygwin,3.0.[0-8]'('*)
+    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 b8197d36a0..b700013f6a 100644
--- a/src/dired.c
+++ b/src/dired.c
@@ -41,10 +41,6 @@
 #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	other threads:[~2019-06-29  6:26 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-06-27 19:28 bug#36405: 26.2.90; O_PATH problem on some versions of Cygwin Ken Brown
2019-06-27 20:47 ` Paul Eggert
2019-06-28  6:25   ` Eli Zaretskii
2019-06-29  6:26     ` Paul Eggert [this message]
2019-06-29  7:06       ` Eli Zaretskii
2019-06-29 18:03         ` Ken Brown
2019-06-29 18:19           ` Eli Zaretskii
2019-06-28 17:57   ` Ken Brown
2019-06-29  6:20     ` Paul Eggert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=cd1ada3b-c764-e2bd-d3ac-4b87000b5250@cs.ucla.edu \
    --to=eggert@cs.ucla.edu \
    --cc=36405@debbugs.gnu.org \
    --cc=eliz@gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.