OSDN Git Service

* path.cc (_readlink): Return ENOENT when file does not exist.
authorcgf <cgf>
Tue, 31 Oct 2000 23:01:20 +0000 (23:01 +0000)
committercgf <cgf>
Tue, 31 Oct 2000 23:01:20 +0000 (23:01 +0000)
winsup/cygwin/ChangeLog
winsup/cygwin/path.cc

index 2ddf461..c3fd690 100644 (file)
@@ -1,3 +1,7 @@
+Tue Oct 31 17:57:52 2000  Christopher Faylor <cgf@cygnus.com>
+
+       * path.cc (_readlink): Return ENOENT when file does not exist.
+
 Tue Oct 31 23:35:00 2000  Corinna Vinschen <corinna@vinschen.de>
 
        * fhandler.h (fhandler_dev_raw): Add method `fixup_after_exec'.
index ff622e9..7899a05 100644 (file)
@@ -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)