On 10/24/21 1:44 PM, Jim Avera wrote:
# Note: Ignore errors when closing pipes, as the user might have manually closed # the fds using 'exec {varname}>&-' or similar.

Actually this isn't a good idea because the fd might have been re-used for something else; so an error should be reported to make that bug-condition noticeable so it can be fixed.

Instead, bash should search all active CPROC variables for any file descriptors being closed explicitly, and undef the corresponding COPROC slot; that will prevent bash from calling close() on a previously-closed file descriptor.

-Jim


Reply via email to