summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2006-06-13 21:11:39 +0000
committerDavid Cantrell <dcantrell@redhat.com>2006-06-13 21:11:39 +0000
commitbcbfe79fc6643de113da722a4f331f02ad0b6c3c (patch)
tree269485c9090e5816b8a64333535e8c488f38ab4e
parent5afa1354756e44201f8195f33aefcb7cc398c960 (diff)
downloadanaconda-bcbfe79fc6643de113da722a4f331f02ad0b6c3c.tar.gz
anaconda-bcbfe79fc6643de113da722a4f331f02ad0b6c3c.tar.xz
anaconda-bcbfe79fc6643de113da722a4f331f02ad0b6c3c.zip
* loader2/log.c: Added vaLogMessage() to take va_list argument, make
logMessage() call this function. * loader2/log.c: vaLogMessage() prototype. * loader2/net.c (netlogger): Call vaLogMessage instead of logMessage().
-rw-r--r--ChangeLog7
-rw-r--r--loader2/log.c19
-rw-r--r--loader2/log.h1
-rw-r--r--loader2/net.c2
4 files changed, 17 insertions, 12 deletions
diff --git a/ChangeLog b/ChangeLog
index f6959193f..35b773baa 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2006-06-13 David Cantrell <dcantrell@redhat.com>
+
+ * loader2/log.c: Added vaLogMessage() to take va_list argument, make
+ logMessage() call this function.
+ * loader2/log.c: vaLogMessage() prototype.
+ * loader2/net.c (netlogger): Call vaLogMessage instead of logMessage().
+
2006-06-13 Chris Lumens <clumens@redhat.com>
* iw/network_gui.py (NetworkWindow.getNext): This one's a string
diff --git a/loader2/log.c b/loader2/log.c
index eb3258d46..efaf022de 100644
--- a/loader2/log.c
+++ b/loader2/log.c
@@ -63,34 +63,31 @@ static void printLogHeader(int level, FILE *outfile) {
void logMessage(int level, const char * s, ...) {
va_list args;
+ va_start(args, s);
+ vaLogMessage(level, s, args);
+ va_end(args);
+}
+void vaLogMessage(int level, const char * s, va_list va) {
/* Only log to the screen things that are above the minimum level. */
if (tty_logfile && level >= minLevel) {
- va_start(args, s);
-
printLogHeader(level, tty_logfile);
- vfprintf(tty_logfile, s, args);
+ vfprintf(tty_logfile, s, va);
fprintf(tty_logfile, "\n");
fflush(tty_logfile);
-
- va_end(args);
}
/* But log everything to the file. */
if (file_logfile) {
- va_start(args, s);
-
printLogHeader(level, file_logfile);
- vfprintf(file_logfile, s, args);
+ vfprintf(file_logfile, s, va);
fprintf(file_logfile, "\n");
fflush(file_logfile);
-
- va_end(args);
}
+
return;
}
-
void openLog(int useLocal) {
int flags, fd;
diff --git a/loader2/log.h b/loader2/log.h
index 71cafba1c..c5c38a46a 100644
--- a/loader2/log.h
+++ b/loader2/log.h
@@ -11,6 +11,7 @@
void logMessage(int level, const char * s, ...)
__attribute__ ((format (printf, 2, 3)));
+void vaLogMessage(int level, const char * s, va_list va);
void openLog(int useLocal);
void closeLog(void);
void setLogLevel(int minLevel);
diff --git a/loader2/net.c b/loader2/net.c
index 492e68ac6..71329c5c2 100644
--- a/loader2/net.c
+++ b/loader2/net.c
@@ -800,7 +800,7 @@ void netlogger(void *arg, int priority, char *fmt, va_list va) {
else
p = INFO;
- logMessage(p, fmt, va);
+ vaLogMessage(p, fmt, va);
/*
* Uncomment the function below to get lots of debugging output on