Yet more global-removal. The static variables in logging.c are now
[u/mdw/putty] / plink.c
diff --git a/plink.c b/plink.c
index 34fe30a..528eee6 100644 (file)
--- a/plink.c
+++ b/plink.c
@@ -40,7 +40,7 @@ void modalfatalbox(char *p, ...)
     WSACleanup();
     cleanup_exit(1);
 }
-void connection_fatal(char *p, ...)
+void connection_fatal(void *frontend, char *p, ...)
 {
     va_list ap;
     fprintf(stderr, "FATAL ERROR: ");
@@ -69,11 +69,14 @@ DWORD orig_console_mode;
 
 WSAEVENT netevent;
 
+static Backend *back;
+static void *backhandle;
+
 int term_ldisc(Terminal *term, int mode)
 {
     return FALSE;
 }
-void ldisc_update(int echo, int edit)
+void ldisc_update(void *frontend, int echo, int edit)
 {
     /* Update stdin read mode to reflect changes in line discipline. */
     DWORD mode;
@@ -535,6 +538,8 @@ int main(int argc, char **argv)
            fprintf(stderr, "Unable to open connection:\n%s", error);
            return 1;
        }
+       logctx = log_init(NULL);
+       back->provide_logctx(backhandle, logctx);
        sfree(realhost);
     }
     connopen = 1;