From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED.blaine.gmane.org!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.bugs Subject: bug#36405: 26.2.90; O_PATH problem on some versions of Cygwin Date: Fri, 28 Jun 2019 23:26:09 -0700 Organization: UCLA Computer Science Department Message-ID: References: <9308fcb1-bb7e-229b-aacf-8c55db00fca6@cornell.edu> <83k1d6i5vl.fsf@gnu.org> Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------A17F391C0F22491BC0E3E3C8" Injection-Info: blaine.gmane.org; posting-host="blaine.gmane.org:195.159.176.226"; logging-data="49254"; mail-complaints-to="usenet@blaine.gmane.org" User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.7.1 Cc: 36405@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sat Jun 29 08:27:11 2019 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([209.51.188.17]) by blaine.gmane.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.89) (envelope-from ) id 1hh6pL-000Ce5-8T for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Jun 2019 08:27:11 +0200 Original-Received: from localhost ([::1]:38000 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hh6pK-00012V-9Q for geb-bug-gnu-emacs@m.gmane.org; Sat, 29 Jun 2019 02:27:10 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:33229) by lists.gnu.org with esmtp (Exim 4.86_2) (envelope-from ) id 1hh6pD-0000zY-Jy for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2019 02:27:04 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1hh6pC-0008Qf-JQ for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2019 02:27:03 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:58004) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1hh6pC-0008Qb-FN for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2019 02:27:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1hh6pC-0001hn-BB for bug-gnu-emacs@gnu.org; Sat, 29 Jun 2019 02:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Paul Eggert Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sat, 29 Jun 2019 06:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 36405 X-GNU-PR-Package: emacs Original-Received: via spool by 36405-submit@debbugs.gnu.org id=B36405.15617895806508 (code B ref 36405); Sat, 29 Jun 2019 06:27:02 +0000 Original-Received: (at 36405) by debbugs.gnu.org; 29 Jun 2019 06:26:20 +0000 Original-Received: from localhost ([127.0.0.1]:43315 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hh6oW-0001gt-1J for submit@debbugs.gnu.org; Sat, 29 Jun 2019 02:26:20 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:36190) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1hh6oU-0001gh-DA for 36405@debbugs.gnu.org; Sat, 29 Jun 2019 02:26:18 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id DED57161D2F; Fri, 28 Jun 2019 23:26:12 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id amScURrQLAUH; Fri, 28 Jun 2019 23:26:10 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 250DA161D50; Fri, 28 Jun 2019 23:26:10 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 56EkDVPOkj45; Fri, 28 Jun 2019 23:26:10 -0700 (PDT) Original-Received: from [192.168.1.9] (cpe-23-242-74-103.socal.res.rr.com [23.242.74.103]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id E4E36161D2F; Fri, 28 Jun 2019 23:26:09 -0700 (PDT) In-Reply-To: <83k1d6i5vl.fsf@gnu.org> Content-Language: en-US X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 209.51.188.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:161793 Archived-At: This is a multi-part message in MIME format. --------------A17F391C0F22491BC0E3E3C8 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit 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. --------------A17F391C0F22491BC0E3E3C8 Content-Type: text/x-patch; name="cygwin.diff" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="cygwin.diff" 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; --------------A17F391C0F22491BC0E3E3C8--