Fix a bug when running on an operating system without "bash." (#29131)

* Fix a bug when running on an operating system without "bash."

* add execution condition

* for ci-coverage
revert-31562-mean
GeminiCarrie 5 years ago committed by GitHub
parent a71ea00922
commit 642abe2a48
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -133,7 +133,12 @@ static int shell_popen_fork_internal(const char* real_cmd, bool do_read,
}
close_open_fds_internal();
#if defined(PADDLE_WITH_MUSL)
PCHECK(execl("/bin/sh", "sh", "-c", real_cmd, NULL) >= 0);
#else
PCHECK(execl("/bin/bash", "bash", "-c", real_cmd, NULL) >= 0);
#endif
// Note: just for compilation. the child don't run this line.
_exit(0);
#endif

Loading…
Cancel
Save