Subject: [PATCH] Revised to screen for a failure to open the tty writable; this From: Jeremy White Date: 1140037661 -0600 happened on my amd64 debian box, not sure why. Prevents a crash, though. --- loki_setup/dialog/util.c | 7 +++++-- 1 files changed, 5 insertions(+), 2 deletions(-) f4eacefc20ae8f22ea1328eb44a30f69d22329fc diff --git a/loki_setup/dialog/util.c b/loki_setup/dialog/util.c index 9147e0c..97bdacd 100644 --- a/loki_setup/dialog/util.c +++ b/loki_setup/dialog/util.c @@ -61,7 +61,7 @@ DIALOG_STATE dialog_state; DIALOG_VARS dialog_vars; int defaultno = FALSE; int screen_initialized = 0; -static FILE *my_output; /* prefer to stdout, to support --stdout */ +static FILE *my_output = NULL; /* prefer to stdout, to support --stdout */ #ifdef HAVE_COLOR /* use colors by default? */ @@ -205,7 +205,10 @@ dialog_clear(void) static int my_putc(int ch) { - return fputc(ch, my_output); + if (! my_output) + return EOF; + else + return fputc(ch, my_output); } #endif -- 1.1.5