summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-10-11 16:06:10 +0000
committerChristopher Faylor <me@cgf.cx>2005-10-11 16:06:10 +0000
commit143bf87846a60c0f4055bc922086048db508827d (patch)
tree8ce383df2685c2e966c7696d2fadee81ce6abe2b
parent458e656498b4f26f78e3e225b783116a3ebec8ed (diff)
downloadcygnal-143bf87846a60c0f4055bc922086048db508827d.tar.gz
cygnal-143bf87846a60c0f4055bc922086048db508827d.tar.bz2
cygnal-143bf87846a60c0f4055bc922086048db508827d.zip
* (symlink_info::set_error): Change to return bool if input error should be
ignored. (symlink_info::check): Treat path as a normal file if set_error returns false.
-rw-r--r--winsup/cygwin/ChangeLog7
-rw-r--r--winsup/cygwin/path.cc25
2 files changed, 25 insertions, 7 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 77b6dec4f..6eef4f0e9 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,10 @@
+2005-10-11 Christopher Faylor <cgf@timesys.com>
+
+ * (symlink_info::set_error): Change to return bool if input error
+ should be ignored.
+ (symlink_info::check): Treat path as a normal file if set_error returns
+ false.
+
2005-10-03 Christopher Faylor <cgf@timesys.com>
* cygheap.h (class process_lock): New class.
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index c948eecf7..57b10dc7f 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -101,7 +101,7 @@ struct symlink_info
bool case_check (char *path);
int check_sysfile (const char *path, HANDLE h);
int check_shortcut (const char *path, HANDLE h);
- void set_error (int);
+ bool set_error (int);
};
muto NO_COPY cwdstuff::cwd_lock;
@@ -3130,12 +3130,23 @@ suffix_scan::next ()
}
}
-void
+bool
symlink_info::set_error (int in_errno)
{
- if ((pflags & PATH_NO_ACCESS_CHECK) && in_errno != ENAMETOOLONG)
- return;
- error = in_errno;
+ bool res;
+ if (!(pflags & PATH_NO_ACCESS_CHECK) || in_errno == ENAMETOOLONG || in_errno == EIO)
+ {
+ error = in_errno;
+ res = true;
+ }
+ else if (in_errno == ENOENT)
+ res = true;
+ else
+ {
+ fileattr = FILE_ATTRIBUTE_NORMAL;
+ res = false;
+ }
+ return res;
}
bool
@@ -3243,8 +3254,8 @@ symlink_info::check (char *path, const suffix_info *suffixes, unsigned opt)
fileattr = 0;
goto file_not_symlink;
}
- set_error (geterrno_from_win_error (win_error, EACCES));
- continue;
+ if (set_error (geterrno_from_win_error (win_error, EACCES)))
+ continue;
}
ext_tacked_on = !!*ext_here;