mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
shell_execute: handle some failures
This commit is contained in:
parent
8a6acfbb4a
commit
277040fc7c
|
@ -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
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue