From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 7868) id 815313858402; Fri, 25 Feb 2022 08:32:23 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 815313858402 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: pinfo: Fix exit code when non-cygwin app exits by Ctrl-C. X-Act-Checkin: newlib-cygwin X-Git-Author: Takashi Yano X-Git-Refname: refs/heads/master X-Git-Oldrev: 85f2dca52daa7387a13aa483fc0bf69e387f4502 X-Git-Newrev: 3a6b11c6979e59b850a138cdc78a9819e1065ac4 Message-Id: <20220225083223.815313858402@sourceware.org> Date: Fri, 25 Feb 2022 08:32:23 +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: Fri, 25 Feb 2022 08:32:23 -0000 https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3D3a6b11c6979= e59b850a138cdc78a9819e1065ac4 commit 3a6b11c6979e59b850a138cdc78a9819e1065ac4 Author: Takashi Yano Date: Thu Feb 24 21:04:49 2022 +0900 Cygwin: pinfo: Fix exit code when non-cygwin app exits by Ctrl-C. =20 - Previously, if non-cygwin app exits by Ctrl-C, exit code was 0x00007f00. With this patch, the exit code will be 0x00000002, which means process exited by SIGINT. Diff: --- winsup/cygwin/pinfo.cc | 3 +++ 1 file changed, 3 insertions(+) diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index bce743bfc..bb7c16547 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -156,6 +156,9 @@ pinfo::status_exit (DWORD x) a lengthy small_printf instead. */ x =3D SIGBUS; break; + case STATUS_CONTROL_C_EXIT: + x =3D SIGINT; + break; default: debug_printf ("*** STATUS_%y\n", x); x =3D 127 << 8;