X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/putty/blobdiff_plain/a832773496d46caa5e328d36a15b4918f24a804e..37ea5668ad31c1ae5427fa5fa0fae7143d5e6ddf:/console.c diff --git a/console.c b/console.c index 703e6837..27366dee 100644 --- a/console.c +++ b/console.c @@ -15,6 +15,8 @@ int console_batch_mode = FALSE; +static void *console_logctx = NULL; + /* * Clean up and exit. */ @@ -26,12 +28,10 @@ void cleanup_exit(int code) sk_cleanup(); WSACleanup(); - if (cfg.protocol == PROT_SSH) { - random_save_seed(); + random_save_seed(); #ifdef MSCRYPTOAPI - crypto_wrapup(); + crypto_wrapup(); #endif - } exit(code); } @@ -212,9 +212,6 @@ int askappend(void *frontend, char *filename) char line[32]; - if (cfg.logxfovr != LGXF_ASK) { - return ((cfg.logxfovr == LGXF_OVR) ? 2 : 1); - } if (console_batch_mode) { fprintf(stderr, msgtemplate_batch, FILENAME_MAX, filename); fflush(stderr); @@ -264,8 +261,15 @@ void old_keyfile_warning(void) fputs(message, stderr); } +void console_provide_logctx(void *logctx) +{ + console_logctx = logctx; +} + void logevent(void *frontend, char *string) { + if (console_logctx) + log_eventlog(console_logctx, string); } int console_get_line(const char *prompt, char *str,