From: Takashi Yano Date: Thu, 15 Feb 2024 17:37:46 +0000 (+0900) Subject: Cygwin: console: Fix a bug that cannot handle consoles more than 32. X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=4dd3dc876ca18ffdce88cbb422046cbe4bf23e12;p=newlib-cygwin.git Cygwin: console: Fix a bug that cannot handle consoles more than 32. Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from other terminals.") Signed-off-by: Takashi Yano --- diff --git a/winsup/cygwin/devices.cc b/winsup/cygwin/devices.cc index b14613bc7..5b67fd1da 100644 --- a/winsup/cygwin/devices.cc +++ b/winsup/cygwin/devices.cc @@ -84,7 +84,7 @@ exists_console (const device& dev) if (dev.get_minor () < MAX_CONS_DEV) { unsigned long bitmask = fhandler_console::console_unit (-1); - return bitmask & (1UL << dev.get_minor ()); + return !!(bitmask & (1UL << dev.get_minor ())); } return false; } diff --git a/winsup/cygwin/devices.in b/winsup/cygwin/devices.in index e15a35f25..be54346fb 100644 --- a/winsup/cygwin/devices.in +++ b/winsup/cygwin/devices.in @@ -80,7 +80,7 @@ exists_console (const device& dev) if (dev.get_minor () < MAX_CONS_DEV) { unsigned long bitmask = fhandler_console::console_unit (-1); - return bitmask & (1UL << dev.get_minor ()); + return !!(bitmask & (1UL << dev.get_minor ())); } return false; } diff --git a/winsup/cygwin/release/3.5.1 b/winsup/cygwin/release/3.5.1 index e041f98f3..96d2ad32f 100644 --- a/winsup/cygwin/release/3.5.1 +++ b/winsup/cygwin/release/3.5.1 @@ -18,3 +18,5 @@ Fixes: Addresses: https://github.com/msys2/msys2-runtime/issues/198 - Fix the problem that VMIN and VTIME does not work at all in console. + +- Fix a bug that cannot handle consoles more than 32, rather than 64.