aboutsummaryrefslogtreecommitdiffstats
path: root/community/openjdk7/icedtea-jdk-disable-vfork.patch
blob: 3cd3e5c448475669214bb942ee85ace43ef1628e (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
--- openjdk.orig/jdk/src/solaris/native/java/lang/UNIXProcess_md.c
+++ openjdk/jdk/src/solaris/native/java/lang/UNIXProcess_md.c
@@ -552,7 +552,11 @@
 startChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath) {
     switch (c->mode) {
       case MODE_VFORK:
+// use regular fork when running on musl
+// this should fix deadlocks on aarch64
+#if defined(__GLIBC__) || defined(__UCLIBC__)
         return vforkChild(c);
+#endif	      
       case MODE_FORK:
         return forkChild(c);
 #if defined(__solaris__) || defined(_ALLBSD_SOURCE) || defined(_AIX)
@@ -651,8 +655,12 @@
     if (resultPid < 0) {
         switch (c->mode) {
           case MODE_VFORK:
+// use regular fork when running on musl
+// this should fix deadlocks on aarch64
+#if defined(__GLIBC__) || defined(__UCLIBC__)
             throwIOException(env, errno, "vfork failed");
             break;
+#endif
           case MODE_FORK:
             throwIOException(env, errno, "fork failed");
             break;