-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix a SHOPT_DEVFD process substitution file descriptor
This commit fixes a long-standing bug that caused a file descriptor leak when passing a process substitution to a function. The leak only occured when ksh was compiled with SHOPT_DEVFD; the FIFO method was unaffected. src/cmd/ksh93/sh/xec.c: - When a process substitution is passed to a builtin, the remaining file descriptor is closed with sh_iorestore. Do the same thing when passing a process substitution to a function. - This fix alone isn't enough, as a file descriptor leak could still occur if 'command' was given a function as an argument, then passed a process substitution. Add another sh_iorestore in this edge case to fix the second file descriptor leak. src/cmd/ksh93/include/defs.h: - Since the file descriptor leak is now fixed, remove the workaround that forced ksh to use the FIFO method. Fixes: ksh93#67
- Loading branch information
Showing
3 changed files
with
9 additions
and
8 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