* Makefile.in: Use default rules when compiling cygrun.o.

* dcrt0.cc (host_dependent_constants::init): Limit non-NT platforms to 32K
chunks when copying regions during a fork.
* path.cc (symlink_check_one): Add temporary debugging output.  Simplify
PATH_EXEC test.
* syscalls.cc (stat_suffixes): Null terminate this list.
This commit is contained in:
Christopher Faylor 2000-03-28 21:49:16 +00:00
parent 1b3755ec07
commit d29b6111a5
5 changed files with 26 additions and 12 deletions

View File

@ -1,3 +1,12 @@
Tue Mar 28 16:45:42 2000 Christopher Faylor <cgf@cygnus.com>
* Makefile.in: Use default rules when compiling cygrun.o.
* dcrt0.cc (host_dependent_constants::init): Limit non-NT platforms to
32K chunks when copying regions during a fork.
* path.cc (symlink_check_one): Add temporary debugging output.
Simplify PATH_EXEC test.
* syscalls.cc (stat_suffixes): Null terminate this list.
Sat Mar 25 20:46:39 2000 Christopher Faylor <cgf@cygnus.com> Sat Mar 25 20:46:39 2000 Christopher Faylor <cgf@cygnus.com>
* path.cc (symlink_check_one): Recognize symlink settings from the * path.cc (symlink_check_one): Recognize symlink settings from the

View File

@ -193,9 +193,9 @@ winver_stamp: mkvers.sh include/cygwin/version.h winver.rc $(DLL_OFILES)
touch $@; \ touch $@; \
$(COMPILE_CXX) -o version.o version.cc $(COMPILE_CXX) -o version.o version.cc
cygrun.exe : $(srcdir)/cygrun.c $(DLL_IMPORTS) $(w32api_lib)/libuser32.a \ cygrun.exe : cygrun.o $(DLL_IMPORTS) $(w32api_lib)/libuser32.a \
$(w32api_lib)/libshell32.a $(w32api_lib)/libshell32.a
$(CC) -o $@ -L$(w32api_lib) $(srcdir)/cygrun.c $(CC) -o $@ -L$(w32api_lib) ${word 1,$^}
# #

View File

@ -151,6 +151,7 @@ host_dependent_constants NO_COPY host_dependent;
void void
host_dependent_constants::init () host_dependent_constants::init ()
{ {
extern DWORD chunksize;
/* fhandler_disk_file::lock needs a platform specific upper word /* fhandler_disk_file::lock needs a platform specific upper word
value for locking entire files. value for locking entire files.
@ -169,6 +170,7 @@ host_dependent_constants::init ()
case win32s: case win32s:
win32_upper = 0x00000000; win32_upper = 0x00000000;
shared = FILE_SHARE_READ | FILE_SHARE_WRITE; shared = FILE_SHARE_READ | FILE_SHARE_WRITE;
chunksize = 32 * 1024 * 1024;
break; break;
default: default:

View File

@ -2164,12 +2164,10 @@ symlink_check_one (const char *in_path, char *buf, int buflen, DWORD& fileattr,
if (fileattr & FILE_ATTRIBUTE_DIRECTORY) if (fileattr & FILE_ATTRIBUTE_DIRECTORY)
unixattr |= S_IFDIR; unixattr |= S_IFDIR;
if (! get_file_attribute (TRUE, path, &unixattr)) if (!get_file_attribute (TRUE, path, &unixattr))
{ {
if (unixattr & STD_XBITS) if (unixattr & STD_XBITS)
*pflags |= PATH_EXEC; *pflags |= PATH_EXEC;
if (! S_ISLNK (unixattr))
;
} }
/* Open the file. */ /* Open the file. */
@ -2177,6 +2175,8 @@ symlink_check_one (const char *in_path, char *buf, int buflen, DWORD& fileattr,
h = CreateFileA (path, GENERIC_READ, FILE_SHARE_READ, &sec_none_nih, OPEN_EXISTING, h = CreateFileA (path, GENERIC_READ, FILE_SHARE_READ, &sec_none_nih, OPEN_EXISTING,
FILE_ATTRIBUTE_NORMAL, 0); FILE_ATTRIBUTE_NORMAL, 0);
syscall_printf ("opened '%s'(%p)", path, h);
res = -1; res = -1;
if (h == INVALID_HANDLE_VALUE) if (h == INVALID_HANDLE_VALUE)
__seterrno (); __seterrno ();
@ -2185,6 +2185,7 @@ symlink_check_one (const char *in_path, char *buf, int buflen, DWORD& fileattr,
char cookie_buf[sizeof (SYMLINK_COOKIE) - 1]; char cookie_buf[sizeof (SYMLINK_COOKIE) - 1];
DWORD got; DWORD got;
syscall_printf ("ReadFile");
if (! ReadFile (h, cookie_buf, sizeof (cookie_buf), &got, 0)) if (! ReadFile (h, cookie_buf, sizeof (cookie_buf), &got, 0))
set_errno (EIO); set_errno (EIO);
else if (got == sizeof (cookie_buf) else if (got == sizeof (cookie_buf)
@ -2215,24 +2216,24 @@ symlink_check_one (const char *in_path, char *buf, int buflen, DWORD& fileattr,
&& memcmp (cookie_buf, SOCKET_COOKIE, && memcmp (cookie_buf, SOCKET_COOKIE,
sizeof (cookie_buf)) == 0) sizeof (cookie_buf)) == 0)
{ {
res = 0;
*pflags |= PATH_SOCKET; *pflags |= PATH_SOCKET;
goto close_and_return; goto close_and_return;
} }
else if (*pflags & PATH_EXEC) else
goto close_and_return;
else if (!(*pflags & PATH_EXEC))
{ {
/* Not a symlink, see if executable. */ /* Not a symlink, see if executable. */
if (got >= 2 && if (!(*pflags & PATH_EXEC) && got >= 2 &&
((cookie_buf[0] == '#' && cookie_buf[1] == '!') || ((cookie_buf[0] == '#' && cookie_buf[1] == '!') ||
(cookie_buf[0] == ':' && cookie_buf[1] == '\n'))) (cookie_buf[0] == ':' && cookie_buf[1] == '\n')))
*pflags |= PATH_EXEC; *pflags |= PATH_EXEC;
close_and_return: close_and_return:
syscall_printf ("close_and_return");
CloseHandle (h); CloseHandle (h);
goto file_not_symlink; goto file_not_symlink;
} }
} }
syscall_printf ("breaking from loop");
CloseHandle (h); CloseHandle (h);
break; break;
} }
@ -2241,6 +2242,7 @@ symlink_check_one (const char *in_path, char *buf, int buflen, DWORD& fileattr,
file_not_symlink: file_not_symlink:
set_errno (EINVAL); set_errno (EINVAL);
syscall_printf ("not a symlink");
if (ext_here) if (ext_here)
strcpy (buf, ext_here); strcpy (buf, ext_here);
res = 0; res = 0;

View File

@ -920,7 +920,8 @@ stat_dev (DWORD devn, int unit, unsigned long ino, struct stat *buf)
static suffix_info stat_suffixes[] = static suffix_info stat_suffixes[] =
{ {
suffix_info ("", 1), suffix_info ("", 1),
suffix_info (".exe", 1) suffix_info (".exe", 1),
suffix_info (NULL)
}; };
/* Cygwin internal */ /* Cygwin internal */