shell_execute: handle some failures

This commit is contained in:
def 2020-09-11 09:47:19 +02:00
parent 8a6acfbb4a
commit 277040fc7c

View file

@ -3232,8 +3232,15 @@ PROCESS shell_execute(const char *file)
argv[0] = (char*) file;
argv[1] = NULL;
pid = fork();
if(!pid)
if(pid == -1)
{
return 0;
}
if(pid == 0)
{
execv(file, argv);
exit(1);
}
return pid;
#endif
}