diff options
author | Corinna Vinschen <corinna@vinschen.de> | 2012-04-04 12:45:24 +0000 |
---|---|---|
committer | Corinna Vinschen <corinna@vinschen.de> | 2012-04-04 12:45:24 +0000 |
commit | ffcd2c3f894413870b4431677d94044ca0336c1b (patch) | |
tree | 2583b53962456dc70c128da496312eb5106e7fa4 /winsup/cygwin/fhandler_nodevice.cc | |
parent | ce508e512aa91b03dfe35e20182f4b80ebde135c (diff) | |
download | cygnal-ffcd2c3f894413870b4431677d94044ca0336c1b.tar.gz cygnal-ffcd2c3f894413870b4431677d94044ca0336c1b.tar.bz2 cygnal-ffcd2c3f894413870b4431677d94044ca0336c1b.zip |
* 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/fhandler_nodevice.cc')
-rw-r--r-- | winsup/cygwin/fhandler_nodevice.cc | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/winsup/cygwin/fhandler_nodevice.cc b/winsup/cygwin/fhandler_nodevice.cc index 4ffe2c447..39842d394 100644 --- a/winsup/cygwin/fhandler_nodevice.cc +++ b/winsup/cygwin/fhandler_nodevice.cc @@ -15,10 +15,14 @@ details. */ #include "fhandler.h" int -fhandler_nodevice::open (int, mode_t) +fhandler_nodevice::open (int flags, mode_t) { if (!pc.error) set_errno (ENXIO); + /* Fixup EROFS error returned from path_conv if /dev is not backed by real + directory on disk and the file doesn't exist. */ + else if (pc.error == EROFS && (flags & O_ACCMODE) == O_RDONLY) + set_errno (ENOENT); return 0; } |