* path.h: Add a new constant.

* syscalls.cc (_read): Oscillate errno check.
This commit is contained in:
Christopher Faylor 2001-01-22 20:36:38 +00:00
parent c65a318355
commit 4c7b82500d
2 changed files with 10 additions and 34 deletions

View File

@ -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> Mon Jan 22 15:27:12 2001 Christopher Faylor <cgf@cygnus.com>
* include/cygwin/version.h: Bump API to reflect setlogmask. * include/cygwin/version.h: Bump API to reflect setlogmask.

View File

@ -298,7 +298,6 @@ path_conv::check (const char *src, unsigned opt,
these operations again on the newly derived path. */ these operations again on the newly derived path. */
else if (len > 0) else if (len > 0)
{ {
set_has_symlinks ();
if (component == 0 && !need_directory && !(opt & PC_SYM_FOLLOW)) if (component == 0 && !need_directory && !(opt & PC_SYM_FOLLOW))
{ {
set_symlink (); // last component of path is a symlink. 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] == ':')) (tail > path_copy && tail[-1] == ':'))
goto out; // all done 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. */ Pinch off the tail and try again. */
*tail = '\0'; *tail = '\0';
component++; component++;
@ -2373,7 +2372,10 @@ symlink_info::check (const char *in_path, const suffix_info *suffixes)
/* Not a symlink, see if executable. */ /* Not a symlink, see if executable. */
if (!(pflags & PATH_ALL_EXEC) && if (!(pflags & PATH_ALL_EXEC) &&
has_exec_chars (cookie_buf, got)) has_exec_chars (cookie_buf, got))
{
debug_printf ("setting exec flag");
pflags |= PATH_EXEC; pflags |= PATH_EXEC;
}
close_and_return: close_and_return:
CloseHandle (h); CloseHandle (h);
goto file_not_symlink; goto file_not_symlink;
@ -2570,41 +2572,10 @@ chdir (const char *dir)
native_dir[3] = '\0'; native_dir[3] = '\0';
} }
int res = SetCurrentDirectoryA (native_dir) ? 0 : -1; int res = SetCurrentDirectoryA (native_dir) ? 0 : -1;
if (res == -1) if (res == -1)
__seterrno (); __seterrno ();
else if (!path.has_symlinks ())
cygcwd.set (path, dir);
else else
{ cygcwd.set (path, strpbrk (dir, ":\\") != NULL ? NULL : dir);
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] =
}
}
/* Note that we're accessing cwd.posix without a lock here. I didn't think /* Note that we're accessing cwd.posix without a lock here. I didn't think
it was worth locking just for strace. */ it was worth locking just for strace. */