Cygwin: flock: drop checking for artificial console handles

They have been used up to Windows 7 only.

Signed-off-by: Corinna Vinschen <corinna@vinschen.de>
This commit is contained in:
Corinna Vinschen 2022-11-15 21:51:14 +01:00
parent a3af720dee
commit df680fb62d
1 changed files with 2 additions and 4 deletions

View File

@ -951,10 +951,8 @@ fhandler_base::lock (int a_op, struct flock *fl)
a_flags = F_POSIX; /* default */ a_flags = F_POSIX; /* default */
/* FIXME: For BSD flock(2) we need a valid, per file table entry OS handle. /* 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 Therefore we can't allow using flock(2) on nohandle devices. */
pre-Windows 8 console handles (recognized by their odd handle value). */ if ((a_flags & F_FLOCK) && nohandle ())
if ((a_flags & F_FLOCK)
&& (nohandle () || (((uintptr_t) get_handle () & 0x3) == 0x3)))
{ {
set_errno (EINVAL); set_errno (EINVAL);
debug_printf ("BSD locking on nohandle and old-style console devices " debug_printf ("BSD locking on nohandle and old-style console devices "