Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2012-04-19 21:21:32 +0400
committerChristopher Faylor <me@cgf.cx>2012-04-19 21:21:32 +0400
commit080f275bae53c9a03c889014cdc42b02d7837448 (patch)
tree661a03e4fb2aa660fd58d0b903b770c1920ff507 /winsup/cygwin/dtable.cc
parent55dcba98dbd120db696fba3dda62a348599a2889 (diff)
* 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.
Diffstat (limited to 'winsup/cygwin/dtable.cc')
-rw-r--r--winsup/cygwin/dtable.cc11
1 files changed, 9 insertions, 2 deletions
diff --git a/winsup/cygwin/dtable.cc b/winsup/cygwin/dtable.cc
index 27e741c02..c956ec371 100644
--- a/winsup/cygwin/dtable.cc
+++ b/winsup/cygwin/dtable.cc
@@ -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;
}