summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Cantrell <dcantrell@redhat.com>2006-06-14 03:26:49 +0000
committerDavid Cantrell <dcantrell@redhat.com>2006-06-14 03:26:49 +0000
commitf42f802928ff6da6efdef74fab11df6d7bbee9fd (patch)
tree4d466aac0aaf752327b3ae31e38e6e98cb19b81b
parentff4a5c37a4d9f416c2d9c070c066785951835d83 (diff)
downloadanaconda-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--ChangeLog9
-rw-r--r--loader2/log.c17
-rw-r--r--loader2/log.h1
-rw-r--r--loader2/net.c5
4 files changed, 23 insertions, 9 deletions
diff --git a/ChangeLog b/ChangeLog
index d817b5db2..05e42c053 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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) {