This is the mail archive of the cygwin-developers@sourceware.cygnus.com mailing list for the Cygwin project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

readlink() bug.


readlink() should return ENOENT and not EINVAL when it can't
find the target symlink.

ChangeLog:
Wed Oct 13 09:02:32 1999  Kazuhiro Fujieda <fujieda@jaist.ac.jp>
	* path.cc (readlink): Return errno correctly when it can't find
	the target symlink.

--- path.cc-	Wed Oct 13 09:02:02 1999
+++ path.cc	Wed Oct 13 09:02:32 1999
@@ -2224,6 +2224,9 @@ readlink (const char *path, char *buf, i
       return -1;
     }
 
+  if (pathbuf.fileattr == (DWORD) -1)
+    return -1;
+
   if (!pathbuf.issymlink ())
     {
       set_errno (EINVAL);

____
  | AIST      Kazuhiro Fujieda <fujieda@jaist.ac.jp>
  | HOKURIKU  School of Information Science
o_/ 1990      Japan Advanced Institute of Science and Technology

Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]