X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/aef05b788c268d43559a0183d1efe9c458724b94..c6940f12e2ad6ba778324f50b9a779db36238518:/unix/uxplink.c diff --git a/unix/uxplink.c b/unix/uxplink.c index 38129f96..b4fa6da1 100644 --- a/unix/uxplink.c +++ b/unix/uxplink.c @@ -25,6 +25,8 @@ #define MAX_STDIN_BACKLOG 4096 +void *logctx; + void fatalbox(char *p, ...) { va_list ap; @@ -33,6 +35,10 @@ void fatalbox(char *p, ...) vfprintf(stderr, p, ap); va_end(ap); fputc('\n', stderr); + if (logctx) { + log_free(logctx); + logctx = NULL; + } cleanup_exit(1); } void modalfatalbox(char *p, ...) @@ -43,6 +49,10 @@ void modalfatalbox(char *p, ...) vfprintf(stderr, p, ap); va_end(ap); fputc('\n', stderr); + if (logctx) { + log_free(logctx); + logctx = NULL; + } cleanup_exit(1); } void connection_fatal(void *frontend, char *p, ...) @@ -53,6 +63,10 @@ void connection_fatal(void *frontend, char *p, ...) vfprintf(stderr, p, ap); va_end(ap); fputc('\n', stderr); + if (logctx) { + log_free(logctx); + logctx = NULL; + } cleanup_exit(1); } void cmdline_error(char *p, ...) @@ -534,6 +548,8 @@ static void usage(void) printf(" -m file read remote command(s) from file\n"); printf(" -s remote command is an SSH subsystem (SSH-2 only)\n"); printf(" -N don't start a shell/command (SSH-2 only)\n"); + printf(" -nc host:port\n"); + printf(" open tunnel in place of session (SSH-2 only)\n"); exit(1); } @@ -554,7 +570,7 @@ int main(int argc, char **argv) int exitcode; int errors; int use_subsystem = 0; - void *ldisc, *logctx; + void *ldisc; long now; fdlist = NULL; @@ -813,7 +829,7 @@ int main(int argc, char **argv) cfg.host[p1] = '\0'; } - if (!cfg.remote_cmd_ptr && !*cfg.remote_cmd) + if (!cfg.remote_cmd_ptr && !*cfg.remote_cmd && !*cfg.ssh_nc_host) flags |= FLAG_INTERACTIVE; /*