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:45:24 +0400
committerCorinna Vinschen <corinna@vinschen.de>2012-04-04 16:45:24 +0400
commitffcd2c3f894413870b4431677d94044ca0336c1b (patch)
tree2583b53962456dc70c128da496312eb5106e7fa4 /winsup/cygwin/fhandler_nodevice.cc
parentce508e512aa91b03dfe35e20182f4b80ebde135c (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/fhandler_nodevice.cc')
-rw-r--r--winsup/cygwin/fhandler_nodevice.cc6
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;
}