changeset 2119:1036eb0a0543

Work-around OpenBSD's lack of $ORIGIN support by pre-loading libnet.so
author kurt
date Mon, 31 Jan 2011 18:18:48 -0500
parents 0b644a2e60e8
children 7485f1770f80
files src/share/vm/runtime/os.cpp
diffstat 1 files changed, 7 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/share/vm/runtime/os.cpp	Mon Jan 31 15:31:07 2011 -0500
+++ b/src/share/vm/runtime/os.cpp	Mon Jan 31 18:18:48 2011 -0500
@@ -391,6 +391,13 @@
     if (_native_java_library == NULL) {
       vm_exit_during_initialization("Unable to load native library", ebuf);
     }
+
+#if defined(__OpenBSD__)
+    // Work-around OpenBSD's lack of $ORIGIN support by pre-loading libnet.so
+    // ignore errors
+    dll_build_name(buffer, sizeof(buffer), Arguments::get_dll_dir(), "net");
+    dll_load(buffer, ebuf, sizeof(ebuf));
+#endif
   }
   static jboolean onLoaded = JNI_FALSE;
   if (onLoaded) {