aboutsummaryrefslogtreecommitdiffstats
path: root/win32/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'win32/file.c')
-rw-r--r--win32/file.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/win32/file.c b/win32/file.c
index 46a7ec7d5d..85aea15d71 100644
--- a/win32/file.c
+++ b/win32/file.c
@@ -689,7 +689,10 @@ rb_readlink(VALUE path, rb_encoding *resultenc)
ALLOCV_END(wpathbuf);
if (e) {
ALLOCV_END(wtmp);
- rb_syserr_fail_path(rb_w32_map_errno(e), path);
+ if (e != -1)
+ rb_syserr_fail_path(rb_w32_map_errno(e), path);
+ else /* not symlink; maybe volume mount point */
+ rb_syserr_fail_path(EINVAL, path);
}
enc = resultenc;
cp = path_cp = code_page(enc);