Skip to content

Commit bdf1d02

Browse files
bobpengxieRealCLanger
bobpengxie
authored andcommitted
8274293: Build failure on macOS with Xcode 13.0 as vfork is deprecated
Reviewed-by: phh Backport-of: 252aaa9249d8979366b37d59487b5b039d923e35
1 parent 8faf1c7 commit bdf1d02

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

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

+4-4
Original file line numberDiff line numberDiff line change
@@ -347,8 +347,8 @@ static int copystrings(char *buf, int offset, const char * const *arg) {
347347
__attribute_noinline__
348348
#endif
349349

350-
/* vfork(2) is deprecated on Solaris */
351-
#ifndef __solaris__
350+
/* vfork(2) is deprecated on Solaris and Darwin */
351+
#if !defined(__APPLE__) && !defined(__solaris__)
352352
static pid_t
353353
vforkChild(ChildStuff *c) {
354354
volatile pid_t resultPid;
@@ -478,8 +478,8 @@ spawnChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath)
478478
static pid_t
479479
startChild(JNIEnv *env, jobject process, ChildStuff *c, const char *helperpath) {
480480
switch (c->mode) {
481-
/* vfork(2) is deprecated on Solaris */
482-
#ifndef __solaris__
481+
/* vfork(2) is deprecated on Solaris and Darwin */
482+
#if !defined(__APPLE__) && !defined(__solaris__)
483483
case MODE_VFORK:
484484
return vforkChild(c);
485485
#endif

0 commit comments

Comments
 (0)