* include/cygwin/version.h: Bump API to reflect setlogmask.

This commit is contained in:
Christopher Faylor 2001-01-22 20:29:24 +00:00
parent 29c39fe3dd
commit c65a318355
5 changed files with 45 additions and 11 deletions

View File

@ -1,3 +1,7 @@
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().

View File

@ -123,10 +123,11 @@ details. */
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

View File

@ -298,6 +298,7 @@ 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.
@ -315,7 +316,7 @@ path_conv::check (const char *src, unsigned opt,
(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++;
@ -2372,10 +2373,7 @@ 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;
@ -2572,10 +2570,41 @@ 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
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. */

View File

@ -37,6 +37,7 @@ enum path_types
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
@ -50,6 +51,7 @@ class path_conv
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;}
@ -60,6 +62,7 @@ class path_conv
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;}

View File

@ -245,10 +245,7 @@ beg:
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;
}
@ -264,7 +261,7 @@ beg:
}
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 ());