From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 42E373858003; Tue, 2 Nov 2021 14:47:42 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 42E373858003 Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit From: Corinna Vinschen To: cygwin-cvs@sourceware.org Subject: [newlib-cygwin/cygwin-3_3-branch] Cygwin: console: Fix yet another bug on input when signalled. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/cygwin-3_3-branch X-Git-Oldrev: a4bda4f62652321a78909f31b39b40b4ede5c1c4 X-Git-Newrev: ea64a781c77225f07e70e781a889b7d471bc7eec Message-Id: <20211102144742.42E373858003@sourceware.org> Date: Tue, 2 Nov 2021 14:47:42 +0000 (GMT) X-BeenThere: cygwin-cvs@cygwin.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Cygwin core component git logs List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 02 Nov 2021 14:47:42 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=ea64a781c77225f07e70e781a889b7d471bc7eec commit ea64a781c77225f07e70e781a889b7d471bc7eec Author: Takashi Yano Date: Tue Nov 2 17:09:40 2021 +0900 Cygwin: console: Fix yet another bug on input when signalled. - Currently, read() returns EINTR due to a bug if signal handler is SIG_DFL and the process is suspended by Ctrl-Z and restarted. This patch fixes the issue. Diff: --- winsup/cygwin/fhandler_termios.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler_termios.cc b/winsup/cygwin/fhandler_termios.cc index 012ecb356..b72f01f22 100644 --- a/winsup/cygwin/fhandler_termios.cc +++ b/winsup/cygwin/fhandler_termios.cc @@ -133,7 +133,8 @@ tty_min::kill_pgrp (int sig) siginfo_t si = {0}; si.si_signo = sig; si.si_code = SI_KERNEL; - last_sig = sig; + if (sig > 0 && sig < _NSIG) + last_sig = sig; for (unsigned i = 0; i < pids.npids; i++) {