< prev index next >
src/hotspot/share/logging/logDecorations.cpp
Print this page
@@ -47,11 +47,11 @@
const char* host_name = Atomic::load_acquire(&_host_name);
if (host_name == NULL) {
char buffer[1024];
if (os::get_host_name(buffer, sizeof(buffer))) {
host_name = os::strdup_check_oom(buffer);
- const char* old_value = Atomic::cmpxchg(host_name, &_host_name, (const char*)NULL);
+ const char* old_value = Atomic::cmpxchg(&_host_name, (const char*)NULL, host_name);
if (old_value != NULL) {
os::free((void *) host_name);
host_name = old_value;
}
}
@@ -145,6 +145,5 @@
char* LogDecorations::create_hostname_decoration(char* pos) {
int written = jio_snprintf(pos, DecorationsBufferSize - (pos - _decorations_buffer), "%s", host_name());
ASSERT_AND_RETURN(written, pos)
}
-
< prev index next >