X-Git-Url: https://git.distorted.org.uk/u/mdw/putty/blobdiff_plain/4c472521e531fb420537806e1724c4a7a0041977..d8d6c7e50e1fcf5171ec15f8a3e9bdcd141f0b64:/plink.c diff --git a/plink.c b/plink.c index 6c211503..f8a9f7ce 100644 --- a/plink.c +++ b/plink.c @@ -444,6 +444,7 @@ int main(int argc, char **argv) SOCKET *sklist; int skcount, sksize; int connopen; + int exitcode; char extra_portfwd[sizeof(cfg.portfwd)]; ssh_get_line = get_line; @@ -967,5 +968,10 @@ int main(int argc, char **argv) break; /* we closed the connection */ } WSACleanup(); - return 0; + exitcode = back->exitcode(); + if (exitcode < 0) { + fprintf(stderr, "Remote process exit code unavailable\n"); + exitcode = 1; /* this is an error condition */ + } + return exitcode; }