bug-bash
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Fri, 20 Mar 2020 11:28:38 +0000

This just made me sad:

tedious_function() {
  : # lots of stuff
} {BASH_XTRACEFD}>/dev/null

it would be so cool to be able to disable debug output BASH_XTRACEFD like
that whether or not BASH_XTRACEFD was set.
I guess the variable would have to be local to the function invocation too.

Please add it to the wishlist for bash 5 ;-)


On Thu, 25 Jul 2019 at 15:11, Chet Ramey <address@hidden> wrote:

> On 7/25/19 9:03 AM, Sam Liddicott wrote:
>
> > Perhaps if the named fd is also closed on the same statement that opened
> > it, it could be kept closed rather than saved and re-opened.
> > Being closed at the same statement is a strong indicator that it was only
> > used to aid fd transplants. Why keep open what the author closed?
>
> That's an interesting suggestion. I considered it at some point, and
> there's even a comment in the code about it. I'll look at it again.
>
> Chet
>
> --
> ``The lyf so short, the craft so long to lerne.'' - Chaucer
>                  ``Ars longa, vita brevis'' - Hippocrates
> Chet Ramey, UTech, CWRU    address@hidden    http://tiswww.cwru.edu/~chet/
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]