public inbox for cygwin-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Cygwin: pinfo: Fix exit code when non-cygwin app exits by Ctrl-C.
@ 2022-02-25  8:32 Takashi Yano
  0 siblings, 0 replies; only message in thread
From: Takashi Yano @ 2022-02-25  8:32 UTC (permalink / raw)
  To: cygwin-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=3a6b11c6979e59b850a138cdc78a9819e1065ac4

commit 3a6b11c6979e59b850a138cdc78a9819e1065ac4
Author: Takashi Yano <takashi.yano@nifty.ne.jp>
Date:   Thu Feb 24 21:04:49 2022 +0900

    Cygwin: pinfo: Fix exit code when non-cygwin app exits by Ctrl-C.
    
    - 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 = SIGBUS;
       break;
+    case STATUS_CONTROL_C_EXIT:
+      x = SIGINT;
+      break;
     default:
       debug_printf ("*** STATUS_%y\n", x);
       x = 127 << 8;


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2022-02-25  8:32 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-25  8:32 [newlib-cygwin] Cygwin: pinfo: Fix exit code when non-cygwin app exits by Ctrl-C Takashi Yano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).