Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > gnu.bash.bug > #15215
| From | Chet Ramey <chet.ramey@case.edu> |
|---|---|
| Newsgroups | gnu.bash.bug |
| Subject | Re: leaks fd for internal functions but not external command |
| Date | 2019-07-23 11:45 -0400 |
| Message-ID | <mailman.2085.1563896731.2688.bug-bash@gnu.org> (permalink) |
| References | (4 earlier) <CAOj-5WBei5KMar7c967=jSwZRsW-Rz-0iL20TQMeuQoz61rfkw@mail.gmail.com> <CAOj-5WA_URW5b7a2EU+rR=T_wbTDEpOM_PSo9yNyU-Dqj+cWaA@mail.gmail.com> <f6acdcca-4c7c-b05c-004d-9b8ceab1e169@case.edu> <CAOj-5WA0b5Lv9GhXkK6gwoS1uVd2B1a0048tZ6sUNnhVHS+ixg@mail.gmail.com> <40109c28-c4a8-2ea0-cc77-e46a584dc011@case.edu> |
On 7/23/19 11:40 AM, Sam Liddicott wrote:
>
> On Tue, 23 Jul 2019 at 16:35, Chet Ramey <chet.ramey@case.edu
> <mailto:chet.ramey@case.edu>> wrote:
>
> On 7/23/19 11:20 AM, Sam Liddicott wrote:
> >
> > On Tue, 23 Jul 2019 at 16:15, Sam Liddicott <sam@liddicott.com
> <mailto:sam@liddicott.com>
> > <mailto:sam@liddicott.com <mailto:sam@liddicott.com>>> wrote:
> >
> >
> >
> > On Tue, 23 Jul 2019 at 16:13, Chet Ramey <chet.ramey@case.edu
> <mailto:chet.ramey@case.edu>
> > <mailto:chet.ramey@case.edu <mailto: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.
>
> You mean case 2 in your original post? That's because redirections are
> performed in the child process forked to run /bin/echo, so the fd never
> exists in the parent process. I thought you were talking about case 1,
> with the builtin echo.
>
>
> No doubt, but this report concerns the inconsistency.
>
> Is using {xxx}>... suppose to give me a file handle I can use as I wish (as
> you say), or not?
So the difference is between cases 1 and 3? That's the difference between
using the {var} syntax and using an explicit file descriptor.
--
``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/
Back to gnu.bash.bug | Previous | Next | Find similar | Unroll thread
Re: leaks fd for internal functions but not external command Chet Ramey <chet.ramey@case.edu> - 2019-07-23 11:45 -0400
csiph-web