From 642abe2a484b6c03da33ce402c813134b080e7e0 Mon Sep 17 00:00:00 2001 From: GeminiCarrie <53326210+GeminiCarrie@users.noreply.github.com> Date: Tue, 1 Dec 2020 18:48:39 +0800 Subject: [PATCH] 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 --- paddle/fluid/framework/io/shell.cc | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/paddle/fluid/framework/io/shell.cc b/paddle/fluid/framework/io/shell.cc index 937f053bf84..62a79f1cb62 100644 --- a/paddle/fluid/framework/io/shell.cc +++ b/paddle/fluid/framework/io/shell.cc @@ -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 -- GitLab