public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Takashi Yano <takashi.yano@nifty.ne.jp>
To: cygwin-patches@cygwin.com
Subject: Re: [PATCH] Cygwin: pinfo: Fix exit code when non-cygwin app exits by Ctrl-C.
Date: Thu, 24 Feb 2022 23:24:04 +0900	[thread overview]
Message-ID: <20220224232404.475a9505b3ba7fccc862848e@nifty.ne.jp> (raw)
In-Reply-To: <20220224134335.603-1-takashi.yano@nifty.ne.jp>

On Thu, 24 Feb 2022 22:43:35 +0900
Takashi Yano wrote:
> - 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.
> ---
>  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;
> -- 
> 2.35.1

This was not enough. I will submit v2 patch.

-- 
Takashi Yano <takashi.yano@nifty.ne.jp>

      reply	other threads:[~2022-02-24 14:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-24 13:43 Takashi Yano
2022-02-24 14:24 ` Takashi Yano [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220224232404.475a9505b3ba7fccc862848e@nifty.ne.jp \
    --to=takashi.yano@nifty.ne.jp \
    --cc=cygwin-patches@cygwin.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).