summaryrefslogtreecommitdiffstats
path: root/libc
diff options
context:
space:
mode:
authorTom Marshall <tdm@cyngn.com>2015-11-03 11:12:23 -0800
committerTom Marshall <tdm@cyngn.com>2015-11-03 11:12:23 -0800
commite2f0539dee416d6770493a0d90e1bdffa874acf1 (patch)
tree207372acf68775c4df9239a84dc27d14f80038fb /libc
parenta07f3db2022ecec62f0238fcd4095c3b284c9204 (diff)
downloadbionic-e2f0539dee416d6770493a0d90e1bdffa874acf1.zip
bionic-e2f0539dee416d6770493a0d90e1bdffa874acf1.tar.gz
bionic-e2f0539dee416d6770493a0d90e1bdffa874acf1.tar.bz2
bionic: Let popen fall back to /sbin/sh
minivold in recovery uses popen, where /system/bin/sh is not available. Change-Id: I2136b0ca4188b7b44416f5d79492fc006382d4ad
Diffstat (limited to 'libc')
-rw-r--r--libc/include/paths.h1
-rw-r--r--libc/upstream-netbsd/lib/libc/gen/popen.c2
2 files changed, 3 insertions, 0 deletions
diff --git a/libc/include/paths.h b/libc/include/paths.h
index 82c2804..7700cdd 100644
--- a/libc/include/paths.h
+++ b/libc/include/paths.h
@@ -33,6 +33,7 @@
#define _PATHS_H_
#define _PATH_BSHELL "/system/bin/sh"
+#define _PATH_BSHELL2 "/sbin/sh"
#define _PATH_CONSOLE "/dev/console"
#define _PATH_DEFPATH "/sbin:/vendor/bin:/system/sbin:/system/bin:/system/xbin"
#define _PATH_DEV "/dev/"
diff --git a/libc/upstream-netbsd/lib/libc/gen/popen.c b/libc/upstream-netbsd/lib/libc/gen/popen.c
index 593e346..b6ce47c 100644
--- a/libc/upstream-netbsd/lib/libc/gen/popen.c
+++ b/libc/upstream-netbsd/lib/libc/gen/popen.c
@@ -152,6 +152,8 @@ popen(const char *command, const char *type)
}
execl(_PATH_BSHELL, "sh", "-c", command, NULL);
+ if (errno == ENOENT)
+ execl(_PATH_BSHELL2, "sh", "-c", command, NULL);
_exit(127);
/* NOTREACHED */
}