public inbox for cygwin-patches@cygwin.com
 help / color / mirror / Atom feed
From: Corinna Vinschen <corinna-cygwin@cygwin.com>
To: cygwin-patches@cygwin.com
Subject: Re: [PATCH] Cygwin: console: Fix exit code for non-cygwin process.
Date: Sat, 3 Feb 2024 16:15:59 +0100	[thread overview]
Message-ID: <Zb5Yr-jfdqyl6nF3@calimero.vinschen.de> (raw)
In-Reply-To: <20240204000430.4e0373736deaec9e72a87a0d@nifty.ne.jp>

On Feb  4 00:04, Takashi Yano wrote:
> On Sat, 3 Feb 2024 15:27:06 +0100 (CET)
> Johannes Schindelin wrote:
> > On IRC, you reported that the thread would crash if `cons` was not fixed
> > up. The symptom was that that crash would apparently prevent the exit code
> > from being read, and it would be left at 0, indicating potentially
> > incorrectly that the non-Cygwin process succeeded.
> > 
> > I wonder: What would it take to change this logic so that the crash would
> > be detected (and not be misinterpreted as exit code 0)?
> 
> I am not sure, but I think it is necessary to modify:
> pinfo::exit()
> pinfo::meybe_set_exit_code_from_windows()
> pinfo::set_exit_code()
> 
> I guess detecting crash of sbub process needs modification of
> spawn.cc.

Dumb question: If, as Johannes said, the error code cannot be fetched,
can't we set the error code to a POSIX return code indicating a signal?

I.e., checking for WIFSIGNALED() returns 1 and WTERMSIG() returns, say,
SIGKILL or something?


Corinna

      reply	other threads:[~2024-02-03 15:16 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-02  5:29 Takashi Yano
2024-02-03 14:24 ` Johannes Schindelin
2024-02-03 14:27   ` Johannes Schindelin
2024-02-03 15:04     ` Takashi Yano
2024-02-03 15:15       ` Corinna Vinschen [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=Zb5Yr-jfdqyl6nF3@calimero.vinschen.de \
    --to=corinna-cygwin@cygwin.com \
    --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).