Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

warning about closing an already closed file descriptor



zsh prints a warning if an already closed file descriptor is to be closed.  
While this is technically correct, the other shells I tried (ksh and bash)
do not print any such warning:

$ bash -c '(true <&-) <&-'
$ ksh -c '(true <&-) <&-'
$ zsh -c '(true <&-) <&-'
zsh:1: failed to close file descriptor 0: bad file descriptor

The warning was introduced by the following commit:
http://sourceforge.net/p/zsh/code/ci/45913f43

... and it causes problems when porting legacy scripts to a newer version
of zsh.  Is there any way to suppress the warning?

If not, how can one achieve compatibility with other shells (including
older versions of zsh)?

Kamil



Messages sorted by: Reverse Date, Date, Thread, Author