public inbox for
help / color / mirror / Atom feed
From: Corinna Vinschen <>
Subject: [newlib-cygwin] Cygwin: flock: drop checking for artificial console handles
Date: Sun,  4 Dec 2022 13:28:17 +0000 (GMT)	[thread overview]
Message-ID: <> (raw);h=df680fb62df0bb0f30e7fda6ab0adc713937cb54

commit df680fb62df0bb0f30e7fda6ab0adc713937cb54
Author:     Corinna Vinschen <>
AuthorDate: Tue Nov 15 21:51:14 2022 +0100
Commit:     Corinna Vinschen <>
CommitDate: Sun Dec 4 14:01:41 2022 +0100

    Cygwin: flock: drop checking for artificial console handles
    They have been used up to Windows 7 only.
    Signed-off-by: Corinna Vinschen <>

 winsup/cygwin/ | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/winsup/cygwin/ b/winsup/cygwin/
index 50db7fe28ed0..0f1efa01d45e 100644
--- a/winsup/cygwin/
+++ b/winsup/cygwin/
@@ -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 "

                 reply	other threads:[~2022-12-04 13:28 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:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \

* 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).