summaryrefslogtreecommitdiff
path: root/kernel/log.cc
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2014-08-02 21:54:30 +0200
committerClifford Wolf <clifford@clifford.at>2014-08-02 21:54:30 +0200
commitbc947d4c7b9b7691e2aeab608c78c4658314cec2 (patch)
tree87b003349626e0201996a5f28b02ec0bc26110ad /kernel/log.cc
parent88cf00ce7874ec7951b09d85e959dd2c6ed261b6 (diff)
Fixed a va_list corruption in logv_error()
Diffstat (limited to 'kernel/log.cc')
-rw-r--r--kernel/log.cc7
1 files changed, 3 insertions, 4 deletions
diff --git a/kernel/log.cc b/kernel/log.cc
index 81cc26da..09673dc2 100644
--- a/kernel/log.cc
+++ b/kernel/log.cc
@@ -113,12 +113,11 @@ void logv_header(const char *format, va_list ap)
void logv_error(const char *format, va_list ap)
{
+ if (log_errfile != NULL)
+ log_files.push_back(log_errfile);
+
log("ERROR: ");
logv(format, ap);
- if (log_errfile != NULL) {
- fprintf(log_errfile, "ERROR: ");
- vfprintf(log_errfile, format, ap);
- }
log_flush();
exit(1);
}