summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/path.cc
diff options
context:
space:
mode:
Diffstat (limited to 'winsup/cygwin/path.cc')
-rw-r--r--winsup/cygwin/path.cc6
1 files changed, 6 insertions, 0 deletions
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index ff622e92b..7899a0520 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -2371,6 +2371,12 @@ readlink (const char *path, char *buf, int buflen)
return -1;
}
+ if (pathbuf.file_attributes () == (DWORD) -1)
+ {
+ set_errno (ENOENT);
+ return -1;
+ }
+
if (!pathbuf.issymlink ())
{
if (pathbuf.fileattr != (DWORD) -1)