src/share/vm/runtime/os.cpp

changeset 4261
6cb0d32b828b
parent 4193
716c64bda5ba
child 4280
80e866b1d053
     1.1 --- a/src/share/vm/runtime/os.cpp	Mon Nov 05 19:33:44 2012 -0500
     1.2 +++ b/src/share/vm/runtime/os.cpp	Wed Nov 07 17:53:02 2012 -0500
     1.3 @@ -397,12 +397,16 @@
     1.4      // Try to load verify dll first. In 1.3 java dll depends on it and is not
     1.5      // always able to find it when the loading executable is outside the JDK.
     1.6      // In order to keep working with 1.2 we ignore any loading errors.
     1.7 -    dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), "verify");
     1.8 -    dll_load(buffer, ebuf, sizeof(ebuf));
     1.9 +    if (dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(),
    1.10 +                       "verify")) {
    1.11 +      dll_load(buffer, ebuf, sizeof(ebuf));
    1.12 +    }
    1.13  
    1.14      // Load java dll
    1.15 -    dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), "java");
    1.16 -    _native_java_library = dll_load(buffer, ebuf, sizeof(ebuf));
    1.17 +    if (dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(),
    1.18 +                       "java")) {
    1.19 +      _native_java_library = dll_load(buffer, ebuf, sizeof(ebuf));
    1.20 +    }
    1.21      if (_native_java_library == NULL) {
    1.22        vm_exit_during_initialization("Unable to load native library", ebuf);
    1.23      }
    1.24 @@ -410,8 +414,10 @@
    1.25  #if defined(__OpenBSD__)
    1.26      // Work-around OpenBSD's lack of $ORIGIN support by pre-loading libnet.so
    1.27      // ignore errors
    1.28 -    dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), "net");
    1.29 -    dll_load(buffer, ebuf, sizeof(ebuf));
    1.30 +    if (dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(),
    1.31 +                       "net")) {
    1.32 +      dll_load(buffer, ebuf, sizeof(ebuf));
    1.33 +    }
    1.34  #endif
    1.35    }
    1.36    static jboolean onLoaded = JNI_FALSE;
    1.37 @@ -1156,7 +1162,7 @@
    1.38    if (inpath == NULL) {
    1.39      return NULL;
    1.40    }
    1.41 -  strncpy(inpath, path, strlen(path));
    1.42 +  strcpy(inpath, path);
    1.43    int count = 1;
    1.44    char* p = strchr(inpath, psepchar);
    1.45    // Get a count of elements to allocate memory

mercurial