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: fhandler_mqueue::mq_open: set all required fhandler flags
Date: Tue, 25 May 2021 21:01:08 +0000 (GMT)	[thread overview]
Message-ID: <20210525210108.A24A2394341C@sourceware.org> (raw)

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

commit 2b4c7f90d4456f527e2a0d63eb73ebde086a6c13
Author: Corinna Vinschen <corinna@vinschen.de>
Date:   Tue May 25 22:43:41 2021 +0200

    Cygwin: fhandler_mqueue::mq_open: set all required fhandler flags
    
    Signed-off-by: Corinna Vinschen <corinna@vinschen.de>

Diff:
---
 winsup/cygwin/fhandler_mqueue.cc | 9 ++++++++-
 1 file changed, 8 insertions(+), 1 deletion(-)

diff --git a/winsup/cygwin/fhandler_mqueue.cc b/winsup/cygwin/fhandler_mqueue.cc
index f3201883d..6215d7b62 100644
--- a/winsup/cygwin/fhandler_mqueue.cc
+++ b/winsup/cygwin/fhandler_mqueue.cc
@@ -26,7 +26,6 @@ fhandler_mqueue::fhandler_mqueue () :
   fhandler_disk_file ()
 {
   filebuf = (char *) ccalloc_abort (HEAP_BUF, 1, FILESIZE);
-  close_on_exec (true);
 }
 
 fhandler_mqueue::~fhandler_mqueue ()
@@ -144,6 +143,14 @@ out:
   else
     mqinfo = mqinfo_open (oflags & O_NONBLOCK);
   mq_open_finish (mqinfo != NULL, created);
+  /* Set fhandler open flags */
+  if (mqinfo)
+    {
+      set_access (GENERIC_READ | SYNCHRONIZE);
+      close_on_exec (true);
+      set_flags (oflags | O_CLOEXEC, O_BINARY);
+      set_open_status ();
+    }
   return mqinfo ? 1 : 0;
 }


                 reply	other threads:[~2021-05-25 21:01 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=20210525210108.A24A2394341C@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).