Cygwin: console: Fix a bug that cannot handle consoles more than 32.

Fixes: 3721a756b0 ("Cygwin: console: Make the console accessible from other terminals.")
Signed-off-by: Takashi Yano <takashi.yano@nifty.ne.jp>
This commit is contained in:
Takashi Yano 2024-02-16 02:37:46 +09:00
parent a85f1c3d0f
commit 577673a170
3 changed files with 4 additions and 2 deletions

View File

@ -84,7 +84,7 @@ exists_console (const device& dev)
if (dev.get_minor () < MAX_CONS_DEV) if (dev.get_minor () < MAX_CONS_DEV)
{ {
unsigned long bitmask = fhandler_console::console_unit (-1); unsigned long bitmask = fhandler_console::console_unit (-1);
return bitmask & (1UL << dev.get_minor ()); return !!(bitmask & (1UL << dev.get_minor ()));
} }
return false; return false;
} }

View File

@ -80,7 +80,7 @@ exists_console (const device& dev)
if (dev.get_minor () < MAX_CONS_DEV) if (dev.get_minor () < MAX_CONS_DEV)
{ {
unsigned long bitmask = fhandler_console::console_unit (-1); unsigned long bitmask = fhandler_console::console_unit (-1);
return bitmask & (1UL << dev.get_minor ()); return !!(bitmask & (1UL << dev.get_minor ()));
} }
return false; return false;
} }

View File

@ -18,3 +18,5 @@ Fixes:
Addresses: https://github.com/msys2/msys2-runtime/issues/198 Addresses: https://github.com/msys2/msys2-runtime/issues/198
- Fix the problem that VMIN and VTIME does not work at all in console. - 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.