Zsh Mailing List Archive
Messages sorted by:
Reverse Date,
Date,
Thread,
Author
Re: warning about closing an already closed file descriptor
On Tue, 20 Jan 2015 12:02:03 +0100
Roman Neuhauser <neuhauser@xxxxxxxxxx> wrote:
> > - ({ 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?
For closing fd's, yes. There's no output to test --- though there is a
status, so we could still test that. And I suppose the lack of an error
message is itself a test...
pws
diff --git a/Test/A04redirect.ztst b/Test/A04redirect.ztst
index cb67788..13f1f7c 100644
--- a/Test/A04redirect.ztst
+++ b/Test/A04redirect.ztst
@@ -152,11 +152,16 @@
>hello
>goodbye
+ ({exec 3<&- } 2>/dev/null
+ exec 3<&-
+ read foo <&-)
+1:'<&-' redirection with numeric fd (no error message on failure)
+
(exec {varid}<&0
exec {varid}<&-
print About to close a second time >&2
read {varid}<&-)
-1:'<&-' redirection
+1:'<&-' redirection with fd in variable (error message on failure)
?About to close a second time
*?\(eval\):*: failed to close file descriptor *
Messages sorted by:
Reverse Date,
Date,
Thread,
Author