diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2012-04-04 16:45:24 +0400 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2012-04-04 16:45:24 +0400 |
commit | ffcd2c3f894413870b4431677d94044ca0336c1b (patch) | |
tree | 2583b53962456dc70c128da496312eb5106e7fa4 /winsup/cygwin/path.cc | |
parent | ce508e512aa91b03dfe35e20182f4b80ebde135c (diff) |
* fhandler_nodevice.cc (fhandler_nodevice::open): Convert EROFS to
ENOENT if non-existent file got opened for reading only. Explain why.
* path.cc (path_conv::check): Stick to ENOENT if file has been opened
for informational purposes only. Add to comment.
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r-- | winsup/cygwin/path.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc index 4fee713ae..6c848fc6f 100644 --- a/winsup/cygwin/path.cc +++ b/winsup/cygwin/path.cc @@ -889,8 +889,11 @@ is_virtual_symlink: 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) + read-only. The PC_KEEP_HANDLE check allows to check for + a call from an informational system call. In that case we + just stick to ENOENT, and the device type doesn't matter + anyway. */ + if (sym.error == ENOENT && !(opt & PC_KEEP_HANDLE)) sym.error = EROFS; else dev.d.devn = FH_FS; |