aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Yano <takashi.yano@nifty.ne.jp>2024-02-16 02:37:46 +0900
committerTakashi Yano <takashi.yano@nifty.ne.jp>2024-02-16 02:40:37 +0900
commit577673a1705398eccf8175228a58a6aa259341fd (patch)
treeda12b5f2d7bc75849af0376a69fd60661c1d42d8
parenta85f1c3d0f22f0bf849f4040f04c5f9785e94feb (diff)
downloadnewlib-577673a1705398eccf8175228a58a6aa259341fd.zip
newlib-577673a1705398eccf8175228a58a6aa259341fd.tar.gz
newlib-577673a1705398eccf8175228a58a6aa259341fd.tar.bz2
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 <takashi.yano@nifty.ne.jp>
-rw-r--r--winsup/cygwin/devices.cc2
-rw-r--r--winsup/cygwin/devices.in2
-rw-r--r--winsup/cygwin/release/3.5.12
3 files changed, 4 insertions, 2 deletions
diff --git a/winsup/cygwin/devices.cc b/winsup/cygwin/devices.cc
index b14613b..5b67fd1 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 e15a35f..be54346 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 e041f98..96d2ad3 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.