The subprocess_create_ex() function just has return -1 in case of an error, without properly closing already open file descriptors.
Example:
|
if (0 != posix_spawnp(&child, commandLine[0], &actions, SUBPROCESS_NULL, |
|
(char *const *)commandLine, used_environment)) { |
|
posix_spawn_file_actions_destroy(&actions); |
|
return -1; |
|
} |
In my test, trying to call this function with a non-existing command results in 6 more new FDs each time.
The
subprocess_create_ex()function just hasreturn -1in case of an error, without properly closing already open file descriptors.Example:
subprocess.h/subprocess.h
Lines 876 to 880 in 7e59b69
In my test, trying to call this function with a non-existing command results in 6 more new FDs each time.