* dtable.cc (fh_alloc): Keep fh which was flagged as error if it is for an

on-disk device and we were stating it.
* path.cc (path_conv::check): Set PATH_KEPT_HANDLE.
* path.h (path_types): Add PATH_KEPT_HANDLE.
(path_conv::kept_handle): Implement.
This commit is contained in:
Christopher Faylor
2012-04-19 17:21:32 +00:00
parent 55dcba98db
commit 080f275bae
4 changed files with 22 additions and 2 deletions

View File

@@ -607,8 +607,15 @@ fh_alloc (path_conv& pc)
fh = cnew (fhandler_nodevice);
else if (fh->dev () == FH_ERROR)
{
delete fh;
fh = NULL;
if (pc.kept_handle () && pc.dev.isfs ())
fh->dev () = pc.dev; /* Special case: This file actually exists on
disk and this is a stat() so just return the
info from pc. */
else
{
delete fh;
fh = NULL;
}
}
return fh;
}