public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: cygwin-cvs@sourceware.org
Subject: [newlib-cygwin] Cygwin: FIFO: tweak fcntl and dup when O_PATH is set
Date: Fri, 24 Jan 2020 10:27:00 -0000	[thread overview]
Message-ID: <20200124102703.31844.qmail@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=7d68ffadd3fbc9b8dcd189d4a20c12a9cd1ed743

commit 7d68ffadd3fbc9b8dcd189d4a20c12a9cd1ed743
Author: Ken Brown <kbrown@cornell.edu>
Date:   Thu Jan 23 16:31:05 2020 +0000

    Cygwin: FIFO: tweak fcntl and dup when O_PATH is set
    
    fhandler_fifo::fcntl and fhandler_fifo::dup now call the corresponding
    fhandler_base methods if the FIFO was opened with the O_PATH flag.

Diff:
---
 winsup/cygwin/fhandler_fifo.cc | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/fhandler_fifo.cc b/winsup/cygwin/fhandler_fifo.cc
index 8cbab35..a338f12 100644
--- a/winsup/cygwin/fhandler_fifo.cc
+++ b/winsup/cygwin/fhandler_fifo.cc
@@ -997,7 +997,7 @@ fhandler_fifo::close ()
 int
 fhandler_fifo::fcntl (int cmd, intptr_t arg)
 {
-  if (cmd != F_SETFL || nohandle ())
+  if (cmd != F_SETFL || nohandle () || (get_flags () & O_PATH))
     return fhandler_base::fcntl (cmd, arg);
 
   const bool was_nonblocking = is_nonblocking ();
@@ -1014,6 +1014,9 @@ fhandler_fifo::dup (fhandler_base *child, int flags)
   int ret = -1;
   fhandler_fifo *fhf = NULL;
 
+  if (get_flags () & O_PATH)
+    return fhandler_base::dup (child, flags);
+
   if (fhandler_base::dup (child, flags))
     goto out;


                 reply	other threads:[~2020-01-24 10:27 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

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=20200124102703.31844.qmail@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=cygwin-cvs@sourceware.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.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).