comparison src/os/windows/vm/os_windows.cpp @ 17595:3eed8712d410

Merge with jdk8u11-b12
author Gilles Duboscq <duboscq@ssw.jku.at>
date Wed, 15 Oct 2014 12:09:28 +0200
parents 534439756990 5656140324ed
children 52b4284cb496
comparison
equal deleted inserted replaced
17560:562643f42b65 17595:3eed8712d410
1 /* 1 /*
2 * Copyright (c) 1997, 2013, Oracle and/or its affiliates. All rights reserved. 2 * Copyright (c) 1997, 2014, Oracle and/or its affiliates. All rights reserved.
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 * 4 *
5 * This code is free software; you can redistribute it and/or modify it 5 * This code is free software; you can redistribute it and/or modify it
6 * under the terms of the GNU General Public License version 2 only, as 6 * under the terms of the GNU General Public License version 2 only, as
7 * published by the Free Software Foundation. 7 * published by the Free Software Foundation.
1817 // JAVA_HOME environment variable 1817 // JAVA_HOME environment variable
1818 // and fix up the path so it looks like 1818 // and fix up the path so it looks like
1819 // libjvm.so is installed there (append a fake suffix 1819 // libjvm.so is installed there (append a fake suffix
1820 // hotspot/libjvm.so). 1820 // hotspot/libjvm.so).
1821 char* java_home_var = ::getenv("JAVA_HOME"); 1821 char* java_home_var = ::getenv("JAVA_HOME");
1822 if (java_home_var != NULL && java_home_var[0] != 0) { 1822 if (java_home_var != NULL && java_home_var[0] != 0 &&
1823 strlen(java_home_var) < (size_t)buflen) {
1823 1824
1824 strncpy(buf, java_home_var, buflen); 1825 strncpy(buf, java_home_var, buflen);
1825 1826
1826 // determine if this is a legacy image or modules image 1827 // determine if this is a legacy image or modules image
1827 // modules image doesn't have "jre" subdirectory 1828 // modules image doesn't have "jre" subdirectory
1835 jio_snprintf(buf + len, buflen-len, "hotspot\\jvm.dll"); 1836 jio_snprintf(buf + len, buflen-len, "hotspot\\jvm.dll");
1836 } 1837 }
1837 } 1838 }
1838 1839
1839 if(buf[0] == '\0') { 1840 if(buf[0] == '\0') {
1840 GetModuleFileName(vm_lib_handle, buf, buflen); 1841 GetModuleFileName(vm_lib_handle, buf, buflen);
1841 } 1842 }
1842 strcpy(saved_jvm_path, buf); 1843 strncpy(saved_jvm_path, buf, MAX_PATH);
1843 } 1844 }
1844 1845
1845 1846
1846 void os::print_jni_name_prefix_on(outputStream* st, int args_size) { 1847 void os::print_jni_name_prefix_on(outputStream* st, int args_size) {
1847 #ifndef _WIN64 1848 #ifndef _WIN64
2301 ctx->MxCsr = MxCsr; 2302 ctx->MxCsr = MxCsr;
2302 return EXCEPTION_CONTINUE_EXECUTION; 2303 return EXCEPTION_CONTINUE_EXECUTION;
2303 } 2304 }
2304 2305
2305 */ 2306 */
2306 #endif //_WIN64 2307 #endif // _WIN64
2307 2308
2308
2309 // Fatal error reporting is single threaded so we can make this a
2310 // static and preallocated. If it's more than MAX_PATH silently ignore
2311 // it.
2312 static char saved_error_file[MAX_PATH] = {0};
2313
2314 void os::set_error_file(const char *logfile) {
2315 if (strlen(logfile) <= MAX_PATH) {
2316 strncpy(saved_error_file, logfile, MAX_PATH);
2317 }
2318 }
2319 2309
2320 static inline void report_error(Thread* t, DWORD exception_code, 2310 static inline void report_error(Thread* t, DWORD exception_code,
2321 address addr, void* siginfo, void* context) { 2311 address addr, void* siginfo, void* context) {
2322 VMError err(t, exception_code, addr, siginfo, context); 2312 VMError err(t, exception_code, addr, siginfo, context);
2323 err.report_and_die(); 2313 err.report_and_die();