On Fri, 29 Sep 2017, Eduardo A. Bustamante López wrote:
> On Fri, Sep 29, 2017 at 11:12:59AM +0200, Mikulas Patocka wrote: > > This patch doesn't revert the above change. It only removes a test if > > $OLDPWD is a directory. With this patch, if $OLDPWD points to a directory, > > there will be no change, and if $OLDPWD points to non-directory, it will > > not be cleared. > > You're right. It doesn't revert it, but it does make it less useful. Is there some reason why do we need to check if $OLDPWD is a real directory? dash and ksh accept the $OLDPWD variable, but don't poke it with the stat syscall. zsh clears $OLDPWD. I think that if bash did the same thing as dash and ksh, it would be acceptable. > > Hung mount shouldn't cause problems unless someone is accessing it. > > My reasoning is that if stat()'ing a directory causes everything to > halt, then perhaps fix the source of that problem? > > There's no reason why bash should make this a special case. The stat syscall doesn't completely halt - it waits until a timeout. But it is still a problem if every bash script is slowed down by the timeout. Mikulas