public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: fhandler_mqueue::mq_open: set all required fhandler flags
@ 2021-05-25 21:01 Corinna Vinschen
0 siblings, 0 replies; only message in thread
From: Corinna Vinschen @ 2021-05-25 21:01 UTC (permalink / raw)
To: cygwin-cvs
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;
}
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-05-25 21:01 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-25 21:01 [newlib-cygwin] Cygwin: fhandler_mqueue::mq_open: set all required fhandler flags Corinna Vinschen
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).