+Mon Jan 22 15:27:12 2001 Christopher Faylor <cgf@cygnus.com>
+
+ * include/cygwin/version.h: Bump API to reflect setlogmask.
+
Sun Jan 21 22:40:25 2001 Jason Tishler <jt@dothill.com>
* cygwin.din: Add export for setlogmask().
30: CW_GET_CYGDRIVE_INFO addition to external.cc
31: Export inet_aton
32: Export getrlimit/setrlimit
+ 33: Export setlogmask
*/
#define CYGWIN_VERSION_API_MAJOR 0
-#define CYGWIN_VERSION_API_MINOR 32
+#define CYGWIN_VERSION_API_MINOR 33
/* There is also a compatibity version number associated with the
shared memory regions. It is incremented when incompatible
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.
(tail > path_copy && tail[-1] == ':'))
goto out; // all done
- /* Haven't found a valid pathname component yet.
+ /* Haven't found an existing pathname component yet.
Pinch off the tail and try again. */
*tail = '\0';
component++;
/* 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;
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
- 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
it was worth locking just for strace. */
PATH_EXEC = MOUNT_EXEC,
PATH_CYGWIN_EXEC = MOUNT_CYGWIN_EXEC,
PATH_ALL_EXEC = PATH_CYGWIN_EXEC | PATH_EXEC,
+ PATH_HAS_SYMLINKS = 0x10000000,
PATH_HASBUGGYOPEN = 0x20000000,
PATH_SOCKET = 0x40000000,
PATH_HASACLS = 0x80000000
unsigned path_flags;
int has_acls () {return path_flags & PATH_HASACLS;}
+ int has_symlinks () {return path_flags & PATH_HAS_SYMLINKS;}
int hasgood_inode () {return path_flags & PATH_HASACLS;} // Not strictly correct
int has_buggy_open () {return path_flags & PATH_HASBUGGYOPEN;}
int isbinary () {return path_flags & PATH_BINARY;}
void set_binary () {path_flags |= PATH_BINARY;}
void set_symlink () {path_flags |= PATH_SYMLINK;}
+ void set_has_symlinks () {path_flags |= PATH_HAS_SYMLINKS;}
void set_exec (int x = 1) {path_flags |= x ? PATH_EXEC : PATH_NOTHING;}
void set_has_acls (int x = 1) {path_flags |= x ? PATH_HASACLS : PATH_NOTHING;}
void set_has_buggy_open (int x = 1) {path_flags |= x ? PATH_HASBUGGYOPEN : PATH_NOTHING;}
if (!wait)
set_sig_errno (EAGAIN); /* Don't really need 'set_sig_errno' here, but... */
else
- {
- set_sig_errno (EINTR);
- sawsig = 1;
- }
+ set_sig_errno (EINTR);
res = -1;
goto out;
}
}
out:
- if (sawsig && call_signal_handler ())
+ if (res < 0 && get_errno () == EINTR && call_signal_handler ())
goto beg;
syscall_printf ("%d = read (%d<%s>, %p, %d), bin %d, errno %d", res, fd, fh->get_name (),
ptr, len, fh->get_r_binary (), get_errno ());