From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7868) id 2E7B4384CBBA; Thu, 15 Feb 2024 17:45:06 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 2E7B4384CBBA DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1708019106; bh=lHx7fo7LLC4Z7N1wSGBBHB27wTCfqFPNVeNv6cXhPlU=; h=From:To:Subject:Date:From; b=XbHyPe84iF72lIY5yWDEc/jZTiHc9JgrxmgwF7ZACk3gJCH/ufDyX3mso8Zwq4hGR g4JsbmsGKnH4KCteMTzBkbbhvTqgoGzyq6Wee8nxhhVpwGh97eluN2L6p0ziQTAz8C dwzJq/Jq6d0E5MdvGmMn9hSbU49mh5odY0n6Jllo= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Takashi Yano To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin] Cygwin: console: Fix a bug that cannot handle consoles more than 32. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/master X-Git-Oldrev: 930e553da8e9bb83b0dee3548c3fc1729095710b X-Git-Newrev: 4dd3dc876ca18ffdce88cbb422046cbe4bf23e12 Message-Id: <20240215174506.2E7B4384CBBA@sourceware.org> Date: Thu, 15 Feb 2024 17:45:06 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D4dd3dc876ca= 18ffdce88cbb422046cbe4bf23e12 commit 4dd3dc876ca18ffdce88cbb422046cbe4bf23e12 Author: Takashi Yano Date: Fri Feb 16 02:37:46 2024 +0900 Cygwin: console: Fix a bug that cannot handle consoles more than 32. =20 Fixes: 3721a756b0d8 ("Cygwin: console: Make the console accessible from= other terminals.") Signed-off-by: Takashi Yano Diff: --- winsup/cygwin/devices.cc | 2 +- winsup/cygwin/devices.in | 2 +- winsup/cygwin/release/3.5.1 | 2 ++ 3 files changed, 4 insertions(+), 2 deletions(-) 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 =3D 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 =3D 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 =20 - 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.