From 1743a11163c0105ddaf9c480e7d1fe3f9c912bd9 Mon Sep 17 00:00:00 2001 From: John Coomes Date: Thu, 20 Sep 2012 16:27:51 -0700 Subject: [PATCH] 7199082: write warning messages to stderr Reviewed-by: ysr, dholmes, sla --- hotspot/src/share/vm/utilities/debug.cpp | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/hotspot/src/share/vm/utilities/debug.cpp b/hotspot/src/share/vm/utilities/debug.cpp index e6a755fcf2b..76164058e01 100644 --- a/hotspot/src/share/vm/utilities/debug.cpp +++ b/hotspot/src/share/vm/utilities/debug.cpp @@ -101,14 +101,13 @@ FormatBufferResource::FormatBufferResource(const char * format, ...) void warning(const char* format, ...) { if (PrintWarnings) { - // In case error happens before init or during shutdown - if (tty == NULL) ostream_init(); - - tty->print("%s warning: ", VM_Version::vm_name()); + FILE* const err = defaultStream::error_stream(); + jio_fprintf(err, "%s warning: ", VM_Version::vm_name()); va_list ap; va_start(ap, format); - tty->vprint_cr(format, ap); + vfprintf(err, format, ap); va_end(ap); + fputc('\n', err); } if (BreakAtWarning) BREAKPOINT; }