-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Browse files
Browse the repository at this point in the history
Turns out that running sh_subfork() when redirecting the output of external commands in command substitutions triggers a race condition on some systems. So we need to limit the workaround to built-ins, without reintroducing previous problems. src/cmd/ksh93/sh/io.c: sh_redirect(): - To limit the workaround, use the sh.redir0 flag set in xec.c -- it's for an optimisation of the 'read' command (introduced in ksh 93u+ 2011-12-24), but we can use the fact that xec.c sets it to 1 for any built-in command right before calling sh_redirect(). This covers permanent redirections with 'exec' and 'redirect' as well. - Check all the redirections for need to fork, in a separate loop. Thanks to @phidebian for the report. Resolves: #688 Resolves: #690
- Loading branch information
Showing
3 changed files
with
32 additions
and
15 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters