core/exec-invoke: drop redundant stdio_fdname checks

exec_context_fdname() would never return NULL if corresponding
stdio mode is set to named fd.
This commit is contained in:
Mike Yuan
2025-10-30 16:12:14 +01:00
parent e984e2ca26
commit 234d8f8bc3
-3
View File
@@ -4765,7 +4765,6 @@ static int exec_context_named_iofds(
for (size_t i = 0; i < n_fds && targets > 0; i++)
if (named_iofds[STDIN_FILENO] < 0 &&
c->std_input == EXEC_INPUT_NAMED_FD &&
stdio_fdname[STDIN_FILENO] &&
streq(p->fd_names[i], stdio_fdname[STDIN_FILENO])) {
named_iofds[STDIN_FILENO] = p->fds[i];
@@ -4773,7 +4772,6 @@ static int exec_context_named_iofds(
} else if (named_iofds[STDOUT_FILENO] < 0 &&
c->std_output == EXEC_OUTPUT_NAMED_FD &&
stdio_fdname[STDOUT_FILENO] &&
streq(p->fd_names[i], stdio_fdname[STDOUT_FILENO])) {
named_iofds[STDOUT_FILENO] = p->fds[i];
@@ -4781,7 +4779,6 @@ static int exec_context_named_iofds(
} else if (named_iofds[STDERR_FILENO] < 0 &&
c->std_error == EXEC_OUTPUT_NAMED_FD &&
stdio_fdname[STDERR_FILENO] &&
streq(p->fd_names[i], stdio_fdname[STDERR_FILENO])) {
named_iofds[STDERR_FILENO] = p->fds[i];