Re: leaks fd for internal functions but not external command
From:
Sam Liddicott
Subject:
Re: leaks fd for internal functions but not external command
Date:
Tue, 23 Jul 2019 16:20:47 +0100
On Tue, 23 Jul 2019 at 16:15, Sam Liddicott <sam@liddicott.com> wrote:
>
>
> On Tue, 23 Jul 2019 at 16:13, Chet Ramey <chet.ramey@case.edu> wrote:
>
>> On 7/23/19 11:11 AM, Sam Liddicott wrote:
>>
>> > The report concerns the different behaviour with internal and external
>> > operations.
>>
>> Right. The close-on-exec is deliberate. That's how it was intended.
>>
>
> Doesn't close-on-exec usually takes effect only on the process that does
> the exec?
> i.e. the fork that does the exec, not the parent process?
>
It got closed in the parent. The lsof is running for the parent, the main
process. /bin/echo has quit before the lsof runs.