summaryrefslogtreecommitdiff
path: root/libc/stdio/popen.c
diff options
context:
space:
mode:
authorUbaldo Porcheddu <ubaldo@eja.it>2016-02-20 22:18:37 +0000
committerWaldemar Brodkorb <wbx@uclibc-ng.org>2016-02-24 22:17:10 +0100
commit75d8660d99f1b5b5da471569955ffce9a27e8702 (patch)
treefaa0f4bd0ff400c88fd77ee54f8fddafe30e3a2b /libc/stdio/popen.c
parente63d716d4b39402294a5f5fbb34e17e094f17748 (diff)
Replaced any occurence of /bin/sh with _PATH_BSHELL to allow easier portability on system with default shell on a different directory, like for instance on android.
Signed-off-by: Ubaldo Porcheddu <ubaldo@eja.it>
Diffstat (limited to 'libc/stdio/popen.c')
-rw-r--r--libc/stdio/popen.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/libc/stdio/popen.c b/libc/stdio/popen.c
index e1b1d4038..1efbd3b7a 100644
--- a/libc/stdio/popen.c
+++ b/libc/stdio/popen.c
@@ -17,6 +17,7 @@
#include <stdio.h>
#include <stdlib.h>
+#include <paths.h>
#include <errno.h>
#include <unistd.h>
#include <sys/wait.h>
@@ -91,7 +92,7 @@ FILE *popen(const char *command, const char *modes)
close(po->f->__filedes);
}
- execl("/bin/sh", "sh", "-c", command, (char *)0);
+ execl(_PATH_BSHELL, "sh", "-c", command, (char *)0);
/* SUSv3 mandates an exit code of 127 for the child if the
* command interpreter can not be invoked. */