Skip to content
This repository was archived by the owner on Feb 2, 2023. It is now read-only.
/ jdk15u-dev Public archive

Commit f76b4e8

Browse files
Olga MikhaltsovaYuri Nesterenko
Olga Mikhaltsova
authored and
Yuri Nesterenko
committed
8274293: Build failure on macOS with Xcode 13.0 as vfork is deprecated
Reviewed-by: yan Backport-of: 252aaa9249d8979366b37d59487b5b039d923e35
1 parent dbb6ebf commit f76b4e8

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

src/java.base/unix/native/libjava/ProcessImpl_md.c

+6-2
Original file line numberDiff line numberDiff line change
@@ -444,7 +444,8 @@ static int copystrings(char *buf, int offset, const char * const *arg) {
444444
__attribute_noinline__
445445
#endif
446446

447-
/* vfork(2) is deprecated on Solaris */
447+
/* vfork(2) is deprecated on Darwin */
448+
#ifndef __APPLE__
448449
static pid_t
449450
vforkChild(ChildStuff *c) {
450451
volatile pid_t resultPid;
@@ -463,6 +464,7 @@ vforkChild(ChildStuff *c) {
463464
assert(resultPid != 0); /* childProcess never returns */
464465
return resultPid;
465466
}
467+
#endif
466468

467469
static pid_t
468470
forkChild(ChildStuff *c) {
@@ -573,9 +575,11 @@ spawnChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath)
573575
static pid_t
574576
startChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath) {
575577
switch (c->mode) {
576-
/* vfork(2) is deprecated on Solaris */
578+
/* vfork(2) is deprecated on Darwin*/
579+
#ifndef __APPLE__
577580
case MODE_VFORK:
578581
return vforkChild(c);
582+
#endif
579583
case MODE_FORK:
580584
return forkChild(c);
581585
case MODE_POSIX_SPAWN:

0 commit comments

Comments
 (0)