summaryrefslogtreecommitdiff
path: root/java/openjdk6/files/icedtea/openjdk/8021355-splashscreen_regression.patch
blob: c5c8d4a08aa28b53d858305655b0593637be020b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
# HG changeset patch
# User ksrini
# Date 1383014349 0
#      Tue Oct 29 02:39:09 2013 +0000
# Node ID a5d00a180798f25254bf6f15b7dc31a0d5df60c2
# Parent  5896fe42b0a429fb5be7abee630b98fa2ec00df3
8021355: REGRESSION: Five closed/java/awt/SplashScreen tests fail since 7u45 b01 on Linux, Solaris
Reviewed-by: dholmes, anthony, ahgross, erikj, omajid

diff -r 5896fe42b0a4 -r a5d00a180798 src/solaris/bin/java_md.c
--- jdk/src/solaris/bin/java_md.c	Wed Aug 07 16:51:59 2013 +0400
+++ jdk/src/solaris/bin/java_md.c	Tue Oct 29 02:39:09 2013 +0000
@@ -46,6 +46,10 @@
 #define JVM_DLL "libjvm.so"
 #define JAVA_DLL "libjava.so"
 
+#define JRE_ERROR1      "Error: Could not find Java SE Runtime Environment."
+#define JRE_ERROR11     "Error: Path length exceeds maximum length (PATH_MAX)"
+#define JRE_ERROR13     "Error: String processing operation failed"
+
 /*
  * If a processor / os combination has the ability to run binaries of
  * two data models and cohabitation of jre/jdk bits with both data
@@ -1700,7 +1704,28 @@
 
 void* SplashProcAddress(const char* name) {
     if (!hSplashLib) {
-        hSplashLib = dlopen(SPLASHSCREEN_SO, RTLD_LAZY | RTLD_GLOBAL);
+        int ret;
+        char jrePath[MAXPATHLEN];
+        char splashPath[MAXPATHLEN];
+
+        if (!GetJREPath(jrePath, sizeof(jrePath), GetArch(), JNI_FALSE)) {
+            ReportErrorMessage(JRE_ERROR1, JNI_TRUE);
+            return NULL;
+        }
+        ret = snprintf(splashPath, sizeof(splashPath), "%s/lib/%s/%s",
+		       jrePath, GetArch(), SPLASHSCREEN_SO);
+
+        if (ret >= (int) sizeof(splashPath)) {
+            ReportErrorMessage(JRE_ERROR11, JNI_TRUE);
+            return NULL;
+        }
+        if (ret < 0) {
+            ReportErrorMessage(JRE_ERROR13, JNI_TRUE);
+            return NULL;
+        }
+        hSplashLib = dlopen(splashPath, RTLD_LAZY | RTLD_GLOBAL);
+	if (_launcher_debug)
+	  printf("Info: loaded %s\n", splashPath);
     }
     if (hSplashLib) {
         void* sym = dlsym(hSplashLib, name);