Skip to content

Commit

Permalink
Close the other file descriptors after redirection has taken place
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Sep 17, 2024
1 parent 4b3058d commit 98cd8b3
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/process/posix/SDL_posixprocess.c
Original file line number Diff line number Diff line change
Expand Up @@ -197,10 +197,6 @@ bool SDL_SYS_CreateProcessWithProperties(SDL_Process *process, SDL_PropertiesID
goto posix_spawn_fail_attr;
}

if (!AddFileDescriptorCloseActions(&fa)) {
goto posix_spawn_fail_all;
}

// Background processes don't have access to the terminal
if (process->background) {
if (stdin_option == SDL_PROCESS_STDIO_INHERITED) {
Expand Down Expand Up @@ -347,6 +343,10 @@ bool SDL_SYS_CreateProcessWithProperties(SDL_Process *process, SDL_PropertiesID
}
}

if (!AddFileDescriptorCloseActions(&fa)) {
goto posix_spawn_fail_all;
}

// Spawn the new process
if (process->background) {
int status = -1;
Expand Down

0 comments on commit 98cd8b3

Please sign in to comment.