Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: warning about closing an already closed file descriptor
# p.stephenson@xxxxxxxxxxx / 2015-01-19 17:28:50 +0000:
> On Mon, 19 Jan 2015 14:59:35 +0000
> Peter Stephenson <p.stephenson@xxxxxxxxxxx> wrote:
> > The problem that change fixed wasn't really intended to have a visible
> > effect, apart from closing f.d.s the shell didn't know about. If it's
> > more useful without the message than with it, it can be removed.
> >...
> > We can special case the {varid}<&- syntax --- that might be useful since
> > it implies the user was previously in direct control of the f.d. so is
> > ikely to be interested in an error if closing it failed.
>
> This easy patch does that. Is anyone other than Kamil interested enough
> to comment?
> diff --git a/Test/A04redirect.ztst b/Test/A04redirect.ztst
> index a39ce46..cb67788 100644
> --- a/Test/A04redirect.ztst
> +++ b/Test/A04redirect.ztst
> @@ -152,11 +152,13 @@
> >hello
> >goodbye
>
> - ({ exec 3<&- } 2>/dev/null
> - exec 3<&-
> - read foo <&-)
> + (exec {varid}<&0
> + exec {varid}<&-
> + print About to close a second time >&2
> + read {varid}<&-)
sorry if i'm talking out of my ass, but does this mean that
the non-{varid} syntax is now without a test?
> 1:'<&-' redirection
> -*?\(eval\):*: failed to close file descriptor 3:*
> +?About to close a second time
> +*?\(eval\):*: failed to close file descriptor *
>
> print foo >&-
> 0:'>&-' redirection
--
roman
Messages sorted by:
Reverse Date,
Date,
Thread,
Author