aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2001-01-22 20:36:38 +0000
committerChristopher Faylor <me@cgf.cx>2001-01-22 20:36:38 +0000
commit4c7b82500d0d04a443106f06fee65afda3874bd4 (patch)
tree048a14bd11989067276768265f4b4f3a591f7252
parentc65a318355fdcd81841088825972d86e642619dd (diff)
downloadnewlib-4c7b82500d0d04a443106f06fee65afda3874bd4.zip
newlib-4c7b82500d0d04a443106f06fee65afda3874bd4.tar.gz
newlib-4c7b82500d0d04a443106f06fee65afda3874bd4.tar.bz2
* path.h: Add a new constant.
* syscalls.cc (_read): Oscillate errno check.
-rw-r--r--winsup/cygwin/ChangeLog5
-rw-r--r--winsup/cygwin/path.cc39
2 files changed, 10 insertions, 34 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index 91f63fa..e663ecc 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,3 +1,8 @@
+Mon Jan 22 15:35:28 2001 Christopher Faylor <cgf@cygnus.com>
+
+ * path.h: Add a new constant.
+ * syscalls.cc (_read): Oscillate errno check.
+
Mon Jan 22 15:27:12 2001 Christopher Faylor <cgf@cygnus.com>
* include/cygwin/version.h: Bump API to reflect setlogmask.
diff --git a/winsup/cygwin/path.cc b/winsup/cygwin/path.cc
index de13b05..d86f194 100644
--- a/winsup/cygwin/path.cc
+++ b/winsup/cygwin/path.cc
@@ -298,7 +298,6 @@ path_conv::check (const char *src, unsigned opt,
these operations again on the newly derived path. */
else if (len > 0)
{
- set_has_symlinks ();
if (component == 0 && !need_directory && !(opt & PC_SYM_FOLLOW))
{
set_symlink (); // last component of path is a symlink.
@@ -316,7 +315,7 @@ path_conv::check (const char *src, unsigned opt,
(tail > path_copy && tail[-1] == ':'))
goto out; // all done
- /* Haven't found an existing pathname component yet.
+ /* Haven't found a valid pathname component yet.
Pinch off the tail and try again. */
*tail = '\0';
component++;
@@ -2373,7 +2372,10 @@ symlink_info::check (const char *in_path, const suffix_info *suffixes)
/* Not a symlink, see if executable. */
if (!(pflags & PATH_ALL_EXEC) &&
has_exec_chars (cookie_buf, got))
+{
+debug_printf ("setting exec flag");
pflags |= PATH_EXEC;
+}
close_and_return:
CloseHandle (h);
goto file_not_symlink;
@@ -2570,41 +2572,10 @@ chdir (const char *dir)
native_dir[3] = '\0';
}
int res = SetCurrentDirectoryA (native_dir) ? 0 : -1;
-
if (res == -1)
__seterrno ();
- else if (!path.has_symlinks ())
- cygcwd.set (path, dir);
else
- {
- char curcwd[MAX_PATH];
- char fulldir[MAX_PATH];
- char *p;
- char **tail[MAX_PATH / 2];
- int len = strlen (dir) + 1;
-
- if (isabspath (dir))
- p = fulldir;
- else
- {
- p = strchr (strcpy (fulldir, cygcwd.get (curcwd)), '\0');
- if (p > fulldir + 1)
- strcpy (p++, "/");
- }
- strcpy (p, dir);
- dir = fulldir;
- for (;;)
- {
- path_conv resolved (dir, PC_SYM_NOFOLLOW | PC_FULL);
- if (resolved.get_attributes () & FILE_ATTRIBUTE_DIRECTORY)
- {
- cygcwd.set (path, dir);
- break;
- }
- char *p = strrchr (dir)
- tail[i] =
- }
- }
+ cygcwd.set (path, strpbrk (dir, ":\\") != NULL ? NULL : dir);
/* Note that we're accessing cwd.posix without a lock here. I didn't think
it was worth locking just for strace. */