diff options
Diffstat (limited to 'src/process/execvp.c')
-rw-r--r-- | src/process/execvp.c | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/process/execvp.c b/src/process/execvp.c index ef3b9dd5..5e6255f7 100644 --- a/src/process/execvp.c +++ b/src/process/execvp.c @@ -5,6 +5,7 @@ #include <limits.h> extern char **__environ; +extern int __execsh(const char *, char *const []); int __execvpe(const char *file, char *const argv[], char *const envp[]) { @@ -54,7 +55,12 @@ int __execvpe(const char *file, char *const argv[], char *const envp[]) int execvp(const char *file, char *const argv[]) { - return __execvpe(file, argv, __environ); + __execvpe(file, argv, __environ); + if (errno == ENOEXEC) { + errno = 0; + return __execsh(file, argv); + } + return -1; } weak_alias(__execvpe, execvpe); |