From aa3ecc4b30012d4412e1f8e73dd648bf5180fda2 Mon Sep 17 00:00:00 2001 From: Guillaume Cottenceau Date: Thu, 4 Dec 2003 16:31:28 +0000 Subject: log_message in drakx mode is better when logged for real --- perl-install/c/stuff.xs.pl | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/perl-install/c/stuff.xs.pl b/perl-install/c/stuff.xs.pl index 2e80b0998..68efef0a2 100644 --- a/perl-install/c/stuff.xs.pl +++ b/perl-install/c/stuff.xs.pl @@ -112,7 +112,30 @@ void initIMPS2() { tcdrain(fd); } -void log_message(const char * s, ...) {} +void log_message(const char * s, ...) { + va_list args; + va_list args_copy; + FILE * logtty = fopen("/dev/tty3", "w"); + if (!logtty) + return; + fprintf(logtty, "* "); + va_start(args, s); + vfprintf(logtty, s, args); + fprintf(logtty, "\n"); + fclose(logtty); + va_end(args); + + logtty = fopen("/tmp/ddebug.log", "a"); + if (!logtty) + return; + fprintf(logtty, "* "); + va_copy(args_copy, args); + va_start(args_copy, s); + vfprintf(logtty, s, args_copy); + fprintf(logtty, "\n"); + fclose(logtty); + va_end(args_copy); +} '; -- cgit v1.2.1