[PATCH] Cygwin: console: Fix exit code for non-cygwin process.
Corinna Vinschen
corinna-cygwin@cygwin.com
Sat Feb 3 15:15:59 GMT 2024
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
More information about the Cygwin-patches
mailing list