summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler_nodevice.cc
diff options
context:
space:
mode:
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;
}