Use execvp instead execv
execvp resolves the executable location using PATH
This commit is contained in:
parent
8ac3b8afe3
commit
f3cd63c137
1 changed files with 1 additions and 1 deletions
2
main.c
2
main.c
|
@ -111,7 +111,7 @@ int main(int argc, const char** argv)
|
|||
|
||||
char** newargs = argdup(argc-1, &argv[1]);
|
||||
|
||||
if (execv(newargs[0], newargs) == -1)
|
||||
if (execvp(newargs[0], newargs) == -1)
|
||||
{
|
||||
printf("Failed to exec (%d)\n", errno);
|
||||
return errno;
|
||||
|
|
Loading…
Reference in a new issue