Use dup2_list_t in posix_spawn

This simplifies the posix_spawn path and unifies it with the fork execution
path.
This commit is contained in:
ridiculousfish
2019-01-29 00:34:38 -08:00
parent d62576ce22
commit 2742267b9e
3 changed files with 12 additions and 54 deletions

View File

@@ -691,8 +691,7 @@ static bool exec_external_command(env_stack_t &vars, const std::shared_ptr<job_t
pid_t pid = 0;
posix_spawnattr_t attr = posix_spawnattr_t();
posix_spawn_file_actions_t actions = posix_spawn_file_actions_t();
bool made_it =
fork_actions_make_spawn_properties(&attr, &actions, j.get(), p, proc_io_chain);
bool made_it = fork_actions_make_spawn_properties(&attr, &actions, j.get(), *dup2s);
if (made_it) {
// We successfully made the attributes and actions; actually call
// posix_spawn.