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:
authorCorinna Vinschen <corinna@vinschen.de>2012-04-04 16:06:21 +0400
committerCorinna Vinschen <corinna@vinschen.de>2012-04-04 16:06:21 +0400
commitce508e512aa91b03dfe35e20182f4b80ebde135c (patch)
tree2441c6b3c70557df530575016469112096ed8468 /winsup/cygwin/path.cc
parent9e1fe26d120edda1adc35a99b859c47106dd9867 (diff)
* path.cc (path_conv::check): Convert device type to FH_FS for
non-existant files on /dev, unless /dev itself doesn't exist on disk. Add comment to explain why.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index 87389141a..4fee713ae 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -882,6 +882,19 @@ is_virtual_symlink:
: sym.fileattr;
path_flags = sym.pflags;
}
+ else if (isdev_dev (dev))
+ {
+ /* If we're looking for a file below /dev, which doesn't exist,
+ make sure that the device type is converted to FH_FS, so that
+ subsequent code handles the file correctly.
+ Unless /dev itself doesn't exist on disk. In that case /dev
+ is handled as virtual filesystem, and virtual filesystems are
+ read-only. */
+ if (sym.error == ENOENT)
+ sym.error = EROFS;
+ else
+ dev.d.devn = FH_FS;
+ }
/* If symlink.check found an existing non-symlink file, then
it sets the appropriate flag. It also sets any suffix found