projects
/
u
/
mdw
/
putty
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
More portability fixes.
[u/mdw/putty]
/
unix
/
uxcons.c
diff --git
a/unix/uxcons.c
b/unix/uxcons.c
index
881b6bf
..
3c79ad6
100644
(file)
--- a/
unix/uxcons.c
+++ b/
unix/uxcons.c
@@
-16,6
+16,8
@@
int console_batch_mode = FALSE;
int console_batch_mode = FALSE;
+static void *console_logctx = NULL;
+
/*
* Clean up and exit.
*/
/*
* Clean up and exit.
*/
@@
-258,9
+260,15
@@
void old_keyfile_warning(void)
fputs(message, stderr);
}
fputs(message, stderr);
}
+void console_provide_logctx(void *logctx)
+{
+ console_logctx = logctx;
+}
+
void logevent(void *frontend, const char *string)
{
void logevent(void *frontend, const char *string)
{
- log_eventlog(logctx, string);
+ if (console_logctx)
+ log_eventlog(console_logctx, string);
}
int console_get_line(const char *prompt, char *str,
}
int console_get_line(const char *prompt, char *str,
@@
-305,3
+313,8
@@
void frontend_keypress(void *handle)
*/
return;
}
*/
return;
}
+
+int is_interactive(void)
+{
+ return isatty(0);
+}