diff options
Diffstat (limited to 'winsup/cygwin/dtable.cc')
-rw-r--r-- | winsup/cygwin/dtable.cc | 11 |
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; } |