summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/fhandler.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/fhandler.cc')
-rw-r--r--winsup/cygwin/fhandler.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/winsup/cygwin/fhandler.cc b/winsup/cygwin/fhandler.cc
index 73fe3f554..ff9a9dfb4 100644
--- a/winsup/cygwin/fhandler.cc
+++ b/winsup/cygwin/fhandler.cc
@@ -1208,9 +1208,11 @@ fhandler_disk_file::open (const char *path, int flags, mode_t mode)
PC_SYM_NOFOLLOW : PC_SYM_FOLLOW);
if (real_path.error &&
- (flags & O_NOSYMLINK || real_path.error != ENOENT || !(flags & O_CREAT)))
+ (flags & O_NOSYMLINK || real_path.error != ENOENT
+ || !(flags & O_CREAT) || real_path.case_clash))
{
- set_errno (real_path.error);
+ set_errno (flags & O_CREAT && real_path.case_clash ? ECASECLASH
+ : real_path.error);
syscall_printf ("0 = fhandler_disk_file::open (%s, %p)", path, flags);
return 0;
}