diff options
author | David Cantrell <dcantrell@redhat.com> | 2006-06-14 03:26:49 +0000 |
---|---|---|
committer | David Cantrell <dcantrell@redhat.com> | 2006-06-14 03:26:49 +0000 |
commit | f42f802928ff6da6efdef74fab11df6d7bbee9fd (patch) | |
tree | 4d466aac0aaf752327b3ae31e38e6e98cb19b81b | |
parent | ff4a5c37a4d9f416c2d9c070c066785951835d83 (diff) | |
download | anaconda-f42f802928ff6da6efdef74fab11df6d7bbee9fd.tar.gz anaconda-f42f802928ff6da6efdef74fab11df6d7bbee9fd.tar.xz anaconda-f42f802928ff6da6efdef74fab11df6d7bbee9fd.zip |
* loader2/log.c: Removed vaLogMessage() and made logMessage() what
it was in a past life.
* loader2/log.h: Removed vaLogMessage() prototype.
* loader2/net.c (netlogger): Make a buffer of an arbitrary size, cram
the va_list in to that using vsnprintf(), pass to logMessage().
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | loader2/log.c | 17 | ||||
-rw-r--r-- | loader2/log.h | 1 | ||||
-rw-r--r-- | loader2/net.c | 5 |
4 files changed, 23 insertions, 9 deletions
@@ -1,3 +1,12 @@ +2006-06-13 David Cantrell <dcantrell@redhat.com> + + * loader2/log.c: Removed vaLogMessage() and made logMessage() what + it was in a past life. + * loader2/log.h: Removed vaLogMessage() prototype. + + * loader2/net.c (netlogger): Make a buffer of an arbitrary size, cram + the va_list in to that using vsnprintf(), pass to logMessage(). + 2006-06-13 Jeremy Katz <katzj@redhat.com> * anaconda.spec: Bump version. diff --git a/loader2/log.c b/loader2/log.c index efaf022de..5c1637dff 100644 --- a/loader2/log.c +++ b/loader2/log.c @@ -63,26 +63,29 @@ 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, va); + vfprintf(tty_logfile, s, args); 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, va); + vfprintf(file_logfile, s, args); fprintf(file_logfile, "\n"); fflush(file_logfile); + + va_end(args); } return; diff --git a/loader2/log.h b/loader2/log.h index c5c38a46a..71cafba1c 100644 --- a/loader2/log.h +++ b/loader2/log.h @@ -11,7 +11,6 @@ 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 19b5f60b6..b0b51f6c5 100644 --- a/loader2/net.c +++ b/loader2/net.c @@ -791,6 +791,8 @@ char *setupInterface(struct networkDeviceConfig *dev) { void netlogger(void *arg, int priority, char *fmt, va_list va) { int p; + int len = 4096; + char buf[len]; if (priority == LOG_ERR) p = ERROR; @@ -803,7 +805,8 @@ void netlogger(void *arg, int priority, char *fmt, va_list va) { else p = INFO; - vaLogMessage(p, fmt, va); + vsnprintf(buf, len - 1, fmt, va); + logMessage(p, buf); } char *doDhcp(struct networkDeviceConfig *dev) { |