|
From: | Chet Ramey |
Subject: | Re: bash-5.1.16 fails to unlink named pipes if pipeline terminates prematurely |
Date: | Mon, 19 Sep 2022 15:49:46 -0400 |
User-agent: | Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:102.0) Gecko/20100101 Thunderbird/102.2.2 |
On 9/12/22 5:52 PM, RVP wrote:
On Fri, 9 Sep 2022, Chet Ramey wrote:Bash is out of the picture by the time the diff command dies due to SIGPIPE. It performs word expansions, including process substitution, and execs diff. It's no longer around to remove the named pipes.Without the `| head' to provoke a SIGPIPE, the named pipes are removed.
It's not the SIGPIPE per se; the bash fatal signal handler removes existing named pipes when it dies due to SIGPIPE. In the pipeline case, bash optimizes away the fork for the `diff' and just executes it. When the SIGPIPE comes, bash is out of the picture. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer ``Ars longa, vita brevis'' - Hippocrates Chet Ramey, UTech, CWRU chet@case.edu http://tiswww.cwru.edu/~chet/
[Prev in Thread] | Current Thread | [Next in Thread] |