builtins to allow stdin to be closed

Prior to this fix, if stdin were explicitly closed, then builtins would
silently fail. For example:

    count <&-

would just fail with status 1. Remove this limitation and allow each
builtin to handle a closed stdin how it sees fit.
This commit is contained in:
ridiculousfish
2021-02-10 17:19:08 -08:00
parent f239329f33
commit 84d59accfc
9 changed files with 44 additions and 8 deletions

View File

@@ -396,8 +396,6 @@ static launch_result_t exec_internal_builtin_proc(parser_t &parser, process_t *p
}
}
if (local_builtin_stdin == -1) return launch_result_t::failed;
// Determine if we have a "direct" redirection for stdin.
bool stdin_is_directly_redirected = false;
if (!p->is_first_in_job) {