From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 152EA385040E; Mon, 1 Feb 2021 10:01:28 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 152EA385040E 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: console: Align the behaviour against signal with pty. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano via Cygwin-patches X-Git-Refname: refs/heads/master X-Git-Oldrev: f186f61d60b342c8167e652073bdc6e3f704a90a X-Git-Newrev: 6ab2d284e54384cc6e7dc13eed1eddd12bd77879 Message-Id: <20210201100128.152EA385040E@sourceware.org> Date: Mon, 1 Feb 2021 10:01:28 +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: Mon, 01 Feb 2021 10:01:28 -0000 https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=6ab2d284e54384cc6e7dc13eed1eddd12bd77879 commit 6ab2d284e54384cc6e7dc13eed1eddd12bd77879 Author: Takashi Yano via Cygwin-patches Date: Fri Jan 29 12:45:44 2021 +0900 Cygwin: console: Align the behaviour against signal with pty. - Currently, read() returns -1 with EINTR if the process is suspended by Ctrl-Z and resumed by fg command, while pty continues to read. For example, xxd command stops with error "Interrupted system call" after Ctrl-Z and fg. This patch aligns the behaviour with pty (and Linux). Diff: --- winsup/cygwin/fhandler_console.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/winsup/cygwin/fhandler_console.cc b/winsup/cygwin/fhandler_console.cc index 0b404411e..3c0783575 100644 --- a/winsup/cygwin/fhandler_console.cc +++ b/winsup/cygwin/fhandler_console.cc @@ -587,7 +587,8 @@ wait_retry: break; case input_signalled: /* signalled */ release_input_mutex (); - goto sig_exit; + /* The signal will be handled by cygwait() above. */ + continue; case input_winch: release_input_mutex (); continue;