]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: pipes: create pipes with synchronization enabled
authorCorinna Vinschen <corinna@vinschen.de>
Fri, 3 Sep 2021 08:32:30 +0000 (10:32 +0200)
committerCorinna Vinschen <corinna@vinschen.de>
Mon, 13 Sep 2021 15:45:54 +0000 (17:45 +0200)
This isn't used by Cygwin, but it might be used by Win32 processes
inheriting the handle.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
winsup/cygwin/fhandler_pipe.cc

index 8b66121b445941f7367108c627e927f5ca913e7e..b69bb1d404769319a1a68fe2b85e48bca016814c 100644 (file)
@@ -659,7 +659,7 @@ nt_create (LPSECURITY_ATTRIBUTES sa_ptr, PHANDLE r, PHANDLE w,
                                 &cygheap->installation_key,
                                 GetCurrentProcessId ());
 
-  access = GENERIC_READ | FILE_WRITE_ATTRIBUTES;
+  access = GENERIC_READ | FILE_WRITE_ATTRIBUTES | SYNCHRONIZE;
 
   ULONG pipe_type = pipe_byte ? FILE_PIPE_BYTE_STREAM_TYPE
     : FILE_PIPE_MESSAGE_TYPE;
@@ -738,7 +738,7 @@ nt_create (LPSECURITY_ATTRIBUTES sa_ptr, PHANDLE r, PHANDLE w,
     {
       debug_printf ("NtOpenFile: name %S", &pipename);
 
-      access = GENERIC_WRITE | FILE_READ_ATTRIBUTES;
+      access = GENERIC_WRITE | FILE_READ_ATTRIBUTES | SYNCHRONIZE;
       status = NtOpenFile (w, access, &attr, &io, 0, 0);
       if (!NT_SUCCESS (status))
        {
This page took 0.030839 seconds and 5 git commands to generate.