aboutsummaryrefslogtreecommitdiff
path: root/libc/bionic/__bionic_get_shell_path.cpp
diff options
context:
space:
mode:
authorJiyong Park <jiyong@google.com>2020-10-26 22:01:17 +0900
committerJiyong Park <jiyong@google.com>2020-10-26 22:02:53 +0900
commit8dd649deac465f15d22b305bcb35f873643c8c59 (patch)
tree9b22cf1a657e662ff0025a416a0df2d65baacdbb /libc/bionic/__bionic_get_shell_path.cpp
parentcf878313b0834b780ba6ffdc91b972371007f16e (diff)
system(3) uses /bin/sh when built for host
/system/bin/sh exists only on Android. When Bionic is built for the host, use the standard /bin/sh. Bug: 159685774 Test: run aosp_cf_arm64_phone on rockpi4 Change-Id: Idf4028c134abc128f203fc4d3be591f06b8fe8ff
Diffstat (limited to 'libc/bionic/__bionic_get_shell_path.cpp')
-rw-r--r--libc/bionic/__bionic_get_shell_path.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/libc/bionic/__bionic_get_shell_path.cpp b/libc/bionic/__bionic_get_shell_path.cpp
index 7aeed182e..c087b3532 100644
--- a/libc/bionic/__bionic_get_shell_path.cpp
+++ b/libc/bionic/__bionic_get_shell_path.cpp
@@ -36,6 +36,10 @@
#define VENDOR_PREFIX "/vendor/"
static const char* init_sh_path() {
+#if !defined(__ANDROID__)
+ // For the host Bionic, use the standard /bin/sh
+ return "/bin/sh";
+#else
/* If the device is not treble enabled, return the path to the system shell.
* Vendor code, on non-treble enabled devices could use system() / popen()
* with relative paths for executables on /system. Since /system will not be
@@ -51,6 +55,7 @@ static const char* init_sh_path() {
}
#endif
return "/system/bin/sh";
+#endif // if !defined(__ANDROID__)
}
const char* __bionic_get_shell_path() {