Skip to content

Commit

Permalink
Avoid using execvpe function.
Browse files Browse the repository at this point in the history
  • Loading branch information
bakpakin committed Oct 9, 2023
1 parent 741a503 commit cb25a2e
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions src/core/os.c
Original file line number Diff line number Diff line change
Expand Up @@ -1247,11 +1247,14 @@ static Janet os_execute_impl(int32_t argc, Janet *argv, JanetExecuteMode mode) {
janet_panic("not supported on windows");
#else
int status;
if (!use_environ) {
environ = envp;
}
do {
if (janet_flag_at(flags, 1)) {
status = execvpe(cargv[0], cargv, use_environ ? environ : envp);
status = execvp(cargv[0], cargv);
} else {
status = execve(cargv[0], cargv, use_environ ? environ : envp);
status = execv(cargv[0], cargv);
}
} while (status == -1 && errno == EINTR);
janet_panicf("%p: %s", cargv[0], strerror(errno ? errno : ENOENT));
Expand Down

0 comments on commit cb25a2e

Please sign in to comment.