summaryrefslogtreecommitdiffstats
path: root/loader/log.c
diff options
context:
space:
mode:
authorJeremy Katz <katzj@redhat.com>2002-06-19 19:23:24 +0000
committerJeremy Katz <katzj@redhat.com>2002-06-19 19:23:24 +0000
commit7f514c5eb0d5189c3e97acf75b261ca1c21c004d (patch)
treed1e0e2890f528f7b31084ef125678448935bbef1 /loader/log.c
parent262e29afc2591f5bdcf937ad928ea74f2d104628 (diff)
downloadanaconda-7f514c5eb0d5189c3e97acf75b261ca1c21c004d.tar.gz
anaconda-7f514c5eb0d5189c3e97acf75b261ca1c21c004d.tar.xz
anaconda-7f514c5eb0d5189c3e97acf75b261ca1c21c004d.zip
now we write out loader log messages to /tmp/anaconda.log also (#62743)
Diffstat (limited to 'loader/log.c')
-rw-r--r--loader/log.c29
1 files changed, 25 insertions, 4 deletions
diff --git a/loader/log.c b/loader/log.c
index 26cd46b91..85b92cfed 100644
--- a/loader/log.c
+++ b/loader/log.c
@@ -12,6 +12,9 @@ static int logfd;
static int logDebugMessages = 0;
#endif
+static FILE * logfile2 = NULL;
+static int logfd2 = 0;
+
static void doLogMessage(const char * s, va_list args);
void logMessage(const char * s, ...) {
@@ -28,17 +31,31 @@ void logMessage(const char * s, ...) {
va_end(args);
+ if (!logfile2) return;
+
+ va_start(args, s);
+
+ fprintf(logfile2, "* ");
+ vfprintf(logfile2, s, args);
+ fprintf(logfile2, "\n");
+ fflush(logfile2);
+
+ va_end(args);
+
return;
}
void openLog(int useLocal) {
if (!useLocal) {
logfile = fopen("/dev/tty3", "w");
- if (logfile)
+ if (logfile) {
logfd = open("/dev/tty3", O_WRONLY);
- else {
- logfile = fopen("/tmp/install.log", "w");
- logfd = open("/tmp/install.log", O_WRONLY| O_APPEND);
+ logfile2 = fopen("/tmp/anaconda.log", "w");
+ if (logfile2)
+ logfd2 = open("/tmp/anaconda.log", O_WRONLY | O_APPEND);
+ } else {
+ logfile = fopen("/tmp/anaconda.log", "w");
+ logfd = open("/tmp/anaconda.log", O_WRONLY| O_APPEND);
}
} else {
logfile = fopen("debug.log", "w");
@@ -54,5 +71,9 @@ void closeLog(void) {
fclose(logfile);
close(logfd);
}
+ if (logfile2) {
+ fclose(logfile2);
+ close(logfd2);
+ }
}