* [bug?] Invalid file descriptor ignored
@ 2016-02-29 6:44 Martijn Dekker
2016-02-29 9:39 ` Peter Stephenson
0 siblings, 1 reply; 3+ messages in thread
From: Martijn Dekker @ 2016-02-29 6:44 UTC (permalink / raw)
To: Zsh hackers list
There is some strange and inconsistent behaviour when trying to write to
a non-open file descriptor. I think the following three test cases
should at least return a non-zero status, but only the third one does:
% echo hi 1>&-; echo $?
0
% { echo hi; } 1>&-; echo $?
zsh: write error: bad file descriptor
0
% echo hi 2>&- 1>&2; echo $?
zsh: 2: bad file descriptor
1
Other shells behaviour, FWIW: All other shells return a non-zero status
for all three cases. (d)ash, bash, yash produce an error message for the
first two cases but not the third. ksh88, ksh93 and {pd,m}ksh are silent
on all three.
Thanks,
- M.
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [bug?] Invalid file descriptor ignored
2016-02-29 6:44 [bug?] Invalid file descriptor ignored Martijn Dekker
@ 2016-02-29 9:39 ` Peter Stephenson
2016-02-29 19:21 ` Bart Schaefer
0 siblings, 1 reply; 3+ messages in thread
From: Peter Stephenson @ 2016-02-29 9:39 UTC (permalink / raw)
To: Zsh hackers list
On Mon, 29 Feb 2016 07:44:52 +0100
Martijn Dekker <martijn@inlv.org> wrote:
> There is some strange and inconsistent behaviour when trying to write to
> a non-open file descriptor.
Yes, I noticed not so long ago that some cases got changed so any error
was deliberately ignored. Bart pointed out an ancient message on the
mailing list about this. I can't remember what that discussion was
about now, though... it doesn't appear to be the discussion about
management of fdtable from mid October.
pws
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [bug?] Invalid file descriptor ignored
2016-02-29 9:39 ` Peter Stephenson
@ 2016-02-29 19:21 ` Bart Schaefer
0 siblings, 0 replies; 3+ messages in thread
From: Bart Schaefer @ 2016-02-29 19:21 UTC (permalink / raw)
To: Zsh hackers list
On Feb 29, 9:39am, Peter Stephenson wrote:
} Subject: Re: [bug?] Invalid file descriptor ignored
}
} On Mon, 29 Feb 2016 07:44:52 +0100
} Martijn Dekker <martijn@inlv.org> wrote:
} > There is some strange and inconsistent behaviour when trying to write to
} > a non-open file descriptor.
}
} Yes, I noticed not so long ago that some cases got changed so any error
} was deliberately ignored. Bart pointed out an ancient message on the
} mailing list about this. I can't remember what that discussion was
} about now, though...
Most recently it was in the [refactor memstream for "print -v"] thread at
the beginning of January.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2016-02-29 19:21 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-02-29 6:44 [bug?] Invalid file descriptor ignored Martijn Dekker
2016-02-29 9:39 ` Peter Stephenson
2016-02-29 19:21 ` Bart Schaefer
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).