|
@@ -355,10 +355,8 @@ bool SDL_SYS_CreateProcessWithProperties(SDL_Process *process, SDL_PropertiesID
|
|
|
case 0:
|
|
case 0:
|
|
|
// Detach from the terminal and launch the process
|
|
// Detach from the terminal and launch the process
|
|
|
setsid();
|
|
setsid();
|
|
|
- if (posix_spawnp(&data->pid, args[0], &fa, &attr, args, envp) != 0) {
|
|
|
|
|
- _exit(errno);
|
|
|
|
|
- }
|
|
|
|
|
- _exit(0);
|
|
|
|
|
|
|
+ int result = posix_spawnp(&data->pid, args[0], &fa, &attr, args, envp);
|
|
|
|
|
+ _exit(result);
|
|
|
|
|
|
|
|
default:
|
|
default:
|
|
|
if (waitpid(pid, &status, 0) < 0) {
|
|
if (waitpid(pid, &status, 0) < 0) {
|
|
@@ -372,8 +370,9 @@ bool SDL_SYS_CreateProcessWithProperties(SDL_Process *process, SDL_PropertiesID
|
|
|
break;
|
|
break;
|
|
|
}
|
|
}
|
|
|
} else {
|
|
} else {
|
|
|
- if (posix_spawnp(&data->pid, args[0], &fa, &attr, args, envp) != 0) {
|
|
|
|
|
- SDL_SetError("posix_spawn() failed: %s", strerror(errno));
|
|
|
|
|
|
|
+ int result = posix_spawnp(&data->pid, args[0], &fa, &attr, args, envp);
|
|
|
|
|
+ if (result != 0) {
|
|
|
|
|
+ SDL_SetError("posix_spawn() failed: %s", strerror(result));
|
|
|
goto posix_spawn_fail_all;
|
|
goto posix_spawn_fail_all;
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|