only exec if chdir worked

This commit is contained in:
Riccardo Mottola 2023-09-18 23:13:41 +02:00
parent 339fb7a131
commit e20b3d59fc

View file

@ -1733,7 +1733,11 @@ GSPrivateCheckTasks()
(void) close(i);
}
(void)chdir(path);
if (0 != chdir(path))
{
exit(-1);
}
(void)execve(executable, (char**)args, (char**)envl);
exit(-1);
}