mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-16 08:30:49 +02:00
change posix-mode implicit redirection from /dev/null for asynchronous commands so that 0<&0 does not count as an explicit redirection for austin-group interp 1913; fix spurious debug message about job notification for -c command; fix error handling for wait builtin if there are no children in a subshell
This commit is contained in:
+10
-11
@@ -847,7 +847,8 @@ execute_command_internal (COMMAND *command, int asynchronous, int pipe_in, int p
|
||||
#endif /* COMMAND_TIMING */
|
||||
|
||||
/* Is this a compound command with a redirection from stdin? POSIX interp
|
||||
1913 makes it matter. */
|
||||
1913 makes it matter. There is an exception for 0<&0 or <&0 or equivalent
|
||||
when in posix mode. */
|
||||
if (shell_control_structure (command->type) && command->redirects)
|
||||
{
|
||||
stdin_redirected = stdin_redirects (command->redirects);
|
||||
@@ -4876,13 +4877,11 @@ run_builtin:
|
||||
{
|
||||
if ((cmdflags & CMD_STDIN_REDIR) &&
|
||||
pipe_in == NO_PIPE &&
|
||||
#if 0 /*TAG:bash-5.4 POSIX interp 1913 */
|
||||
/* POSIX interp 1913 says that the redirection of fd 0
|
||||
from /dev/null is unconditional. */
|
||||
(posixly_correct || stdin_redirects (simple_command->redirects) == 0))
|
||||
#else
|
||||
from /dev/null is performed unless the command has
|
||||
a redirection that's something like 0<&0 or <&0.
|
||||
See redir.c:stdin_redirection() for the details. */
|
||||
(stdin_redirects (simple_command->redirects) == 0))
|
||||
#endif
|
||||
async_redirect_stdin ();
|
||||
setup_async_signals ();
|
||||
}
|
||||
@@ -5917,15 +5916,15 @@ execute_disk_command (WORD_LIST *words, REDIRECT *redirects, char *command_line,
|
||||
in asynchronous children. */
|
||||
if (async)
|
||||
{
|
||||
/*itrace("execute_disk_command: async = 1 cmd_stdin_redir = %d stdin_redirects (redirects) = %d",
|
||||
(cmdflags & CMD_STDIN_REDIR), stdin_redirects (redirects));*/
|
||||
if ((cmdflags & CMD_STDIN_REDIR) &&
|
||||
pipe_in == NO_PIPE &&
|
||||
#if 0 /*TAG:bash-5.4 POSIX interp 1913 */
|
||||
/* POSIX interp 1913 says that the redirection of fd 0
|
||||
from /dev/null is unconditional. */
|
||||
(posixly_correct || stdin_redirects (redirects) == 0))
|
||||
#else
|
||||
from /dev/null is performed unless the command has
|
||||
a redirection that's something like 0<&0 or <&0.
|
||||
See redir.c:stdin_redirection() for the details. */
|
||||
(stdin_redirects (redirects) == 0))
|
||||
#endif
|
||||
async_redirect_stdin ();
|
||||
setup_async_signals ();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user