]> sourceware.org Git - newlib-cygwin.git/commitdiff
Cygwin: flock: drop checking for artificial console handles
authorCorinna Vinschen <corinna@vinschen.de>
Tue, 15 Nov 2022 20:51:14 +0000 (21:51 +0100)
committerCorinna Vinschen <corinna@vinschen.de>
Sun, 4 Dec 2022 13:01:41 +0000 (14:01 +0100)
They have been used up to Windows 7 only.

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

index 50db7fe28ed0731d9c41c9f5d2120a48d8a6ac8f..0f1efa01d45e6b974e50aa682d560f671d6604ce 100644 (file)
@@ -951,10 +951,8 @@ fhandler_base::lock (int a_op, struct flock *fl)
     a_flags = F_POSIX; /* default */
 
   /* FIXME: For BSD flock(2) we need a valid, per file table entry OS handle.
-     Therefore we can't allow using flock(2) on nohandle devices and
-     pre-Windows 8 console handles (recognized by their odd handle value). */
-  if ((a_flags & F_FLOCK)
-      && (nohandle () || (((uintptr_t) get_handle () & 0x3) == 0x3)))
+     Therefore we can't allow using flock(2) on nohandle devices. */
+  if ((a_flags & F_FLOCK) && nohandle ())
     {
       set_errno (EINVAL);
       debug_printf ("BSD locking on nohandle and old-style console devices "
This page took 0.034016 seconds and 5 git commands to generate.