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

Re: Zsh 4.3.12: subshell in midnight commander: precmd: 15: bad file descriptor



On Jul 18,  5:01pm, Peter Stephenson wrote:
} Subject: Re: Zsh 4.3.12: subshell in midnight commander:  precmd: 15: bad 
}
} On Mon, 18 Jul 2011 08:52:34 -0700
} Bart Schaefer <schaefer@xxxxxxxxxxxxxxxx> wrote:
} > Hrm.  So why does it work when starting 4.3.12 from 4.3.9?  How is 11
} > getting to be <= max_zsh_fd inside 4.3.12 that case, whereas it is not
} > when the outer shell is 4.3.12?
} 
} See what lsof says.  I suspect 4.3.9 is leaving open its SHTTY, since
} setting FD_CLOEXEC on that is one of the changes I noted.  That would be
} fd 12, so 11 is <max_zsh_fd.

According to lsof -p $$, the max FD is 10, not 12.

} > *  2978                         else if (fn->fd1 > max_zsh_fd)
} >    2979                             bad = 3;
} 
} Hmm... that's saying we're closing an fd with {foo}>&- syntax that
} we don't know about in the first place.  Do we just try to close it and
} report an error closing an unknown fd if that fails?

Hrm.  Right now it says

zsh: file descriptor 11 out of range, not closed

Strictly speaking there should be some way to close an arbitrary file
descriptor.  If the shell "knows about" all open descriptors that's
not an issue here ...

By the way, unrelated oddness:  Redirections are allowed to appear at
the start of a command like this:

    2>&- true

but

    {foo}>&- true

is a parse error.

-- 



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