1
0
mirror of https://git.tartarus.org/simon/putty.git synced 2025-07-16 18:47:32 -05:00

uxserver: option to generate numeric "exit-signal".

This mimics a bug in some old SSH servers for which PuTTY contains
compensation code (parsing an incoming "exit-signal" two ways and
seeing which one worked). I completely rewrote that code in commit
7535f645a, as part of the BinarySource rework. Now I can finally test
it sensibly.
This commit is contained in:
Simon Tatham
2019-03-30 07:28:38 +00:00
parent 4bb1867788
commit 8d84272d80
4 changed files with 41 additions and 16 deletions

View File

@ -1526,17 +1526,23 @@ static int pty_exitcode(Backend *be)
return WEXITSTATUS(pty->exit_code);
}
ptrlen pty_backend_exit_signame(Backend *be, char **aux_msg)
int pty_backend_exit_signum(Backend *be)
{
Pty *pty = container_of(be, Pty, backend);
int sig;
*aux_msg = NULL;
if (!pty->finished || !WIFSIGNALED(pty->exit_code))
return PTRLEN_LITERAL("");
return -1;
sig = WTERMSIG(pty->exit_code);
return WTERMSIG(pty->exit_code);
}
ptrlen pty_backend_exit_signame(Backend *be, char **aux_msg)
{
*aux_msg = NULL;
int sig = pty_backend_exit_signum(be);
if (sig < 0)
return PTRLEN_LITERAL("");
#define TRANSLATE_SIGNAL(s) do \
{ \