From e2f0539dee416d6770493a0d90e1bdffa874acf1 Mon Sep 17 00:00:00 2001 From: Tom Marshall Date: Tue, 3 Nov 2015 11:12:23 -0800 Subject: bionic: Let popen fall back to /sbin/sh minivold in recovery uses popen, where /system/bin/sh is not available. Change-Id: I2136b0ca4188b7b44416f5d79492fc006382d4ad --- libc/include/paths.h | 1 + libc/upstream-netbsd/lib/libc/gen/popen.c | 2 ++ 2 files changed, 3 insertions(+) (limited to 'libc') 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 */ } -- cgit v1.1