* cygheap.cc (_cfree): Add regparm attribute.
(_crealloc): Ditto. * dcrt0.cc (dll_crt0_1): Default to always checking for executable for now. * dtable.cc (dtable::not_open): Move method. * dtable.h (dtable): Here. * exceptions.cc (ctrl_c_handler): Don't expect process group leader to handle a signal if it doesn't exist. * fhandler.h (fhandler_base): Make openflags protected. * localtime.c (tzsetwall): Check for __CYGWIN__ as well as __WIN32__. * path.cc (path_conv::check): Add some comments. Change strcat to assignment. * lib/_cygwin_S_IEXEC.cc (_cygwin_bob__): Eliminate. * fhandler_tty.cc (fhandler_console::dup): Set controlling terminal if necessary. * fhandler_tty.cc (fhandler_tty_slave::dup): Ditto.
This commit is contained in:
parent
791cada5a2
commit
792011508a
|
@ -1,3 +1,27 @@
|
|||
Tue May 8 11:09:59 2001 Christopher Faylor <cgf@cygnus.com>
|
||||
|
||||
* cygheap.cc (_cfree): Add regparm attribute.
|
||||
(_crealloc): Ditto.
|
||||
|
||||
* dcrt0.cc (dll_crt0_1): Default to always checking for executable for now.
|
||||
|
||||
* dtable.cc (dtable::not_open): Move method.
|
||||
* dtable.h (dtable): Here.
|
||||
|
||||
* exceptions.cc (ctrl_c_handler): Don't expect process group leader to
|
||||
handle a signal if it doesn't exist.
|
||||
|
||||
* fhandler.h (fhandler_base): Make openflags protected.
|
||||
|
||||
* localtime.c (tzsetwall): Check for __CYGWIN__ as well as __WIN32__.
|
||||
|
||||
* path.cc (path_conv::check): Add some comments. Change strcat to assignment.
|
||||
|
||||
* lib/_cygwin_S_IEXEC.cc (_cygwin_bob__): Eliminate.
|
||||
|
||||
* fhandler_tty.cc (fhandler_console::dup): Set controlling terminal if necessary.
|
||||
* fhandler_tty.cc (fhandler_tty_slave::dup): Ditto.
|
||||
|
||||
Mon May 7 21:33:17 2001 Christopher Faylor <cgf@cygnus.com>
|
||||
|
||||
* include/sys/file.h: Revert special X_OK usage. Just make it a
|
||||
|
|
|
@ -115,6 +115,7 @@ _cmalloc (int size)
|
|||
return rvc->data;
|
||||
}
|
||||
|
||||
static void __stdcall _cfree (void *ptr) __attribute__((regparm(1)));
|
||||
static void __stdcall
|
||||
_cfree (void *ptr)
|
||||
{
|
||||
|
@ -126,6 +127,7 @@ _cfree (void *ptr)
|
|||
cygheap_protect->release ();
|
||||
}
|
||||
|
||||
static void *__stdcall _crealloc (void *ptr, int size) __attribute__((regparm(2)));
|
||||
static void *__stdcall
|
||||
_crealloc (void *ptr, int size)
|
||||
{
|
||||
|
|
|
@ -109,7 +109,7 @@ extern "C"
|
|||
/* impure_ptr */ &reent_data,
|
||||
};
|
||||
bool ignore_case_with_glob = FALSE;
|
||||
int __declspec (dllexport) _check_for_executable = FALSE;
|
||||
int __declspec (dllexport) _check_for_executable = TRUE;
|
||||
#ifdef DEBUGGING
|
||||
int pinger = 0;
|
||||
#endif
|
||||
|
@ -753,9 +753,6 @@ dll_crt0_1 ()
|
|||
longjmp (fork_info->jmp, fork_info->cygpid);
|
||||
}
|
||||
|
||||
if (!CYGWIN_VERSION_CHECK_FOR_S_IEXEC)
|
||||
_check_for_executable = TRUE;
|
||||
|
||||
#ifdef DEBUGGING
|
||||
{
|
||||
extern void fork_init ();
|
||||
|
|
|
@ -125,17 +125,6 @@ stdio_init (void)
|
|||
}
|
||||
}
|
||||
|
||||
int
|
||||
dtable::not_open (int fd)
|
||||
{
|
||||
SetResourceLock(LOCK_FD_LIST, READ_LOCK, "not_open");
|
||||
|
||||
int res = fd < 0 || fd >= (int)size || fds[fd] == NULL;
|
||||
|
||||
ReleaseResourceLock(LOCK_FD_LIST, READ_LOCK, "not open");
|
||||
return res;
|
||||
}
|
||||
|
||||
int
|
||||
dtable::find_unused_handle (int start)
|
||||
{
|
||||
|
|
|
@ -11,6 +11,8 @@ details. */
|
|||
/* Initial and increment values for cygwin's fd table */
|
||||
#define NOFILE_INCR 32
|
||||
|
||||
#include "thread.h"
|
||||
|
||||
class dtable
|
||||
{
|
||||
fhandler_base **fds;
|
||||
|
@ -41,7 +43,15 @@ public:
|
|||
fhandler_base *build_fhandler (int fd, DWORD dev, const char *name,
|
||||
int unit = -1);
|
||||
fhandler_base *build_fhandler (int fd, const char *name, HANDLE h);
|
||||
int not_open (int n) __attribute__ ((regparm(1)));
|
||||
int not_open (int fd)
|
||||
{
|
||||
SetResourceLock (LOCK_FD_LIST, READ_LOCK, "not_open");
|
||||
|
||||
int res = fd < 0 || fd >= (int) size || fds[fd] == NULL;
|
||||
|
||||
ReleaseResourceLock (LOCK_FD_LIST, READ_LOCK, "not open");
|
||||
return res;
|
||||
}
|
||||
int find_unused_handle (int start);
|
||||
int find_unused_handle () { return find_unused_handle (first_fd_for_open);}
|
||||
void release (int fd);
|
||||
|
|
|
@ -904,8 +904,9 @@ ctrl_c_handler (DWORD type)
|
|||
tty_min *t = cygwin_shared->tty.get_tty (myself->ctty);
|
||||
/* Ignore this if we're not the process group lead since it should be handled
|
||||
*by* the process group leader. */
|
||||
if (t->getpgid () && (t->getpgid () != myself->pid ||
|
||||
(GetTickCount () - t->last_ctrl_c) < MIN_CTRL_C_SLOP))
|
||||
if (t->getpgid () && pid_exists (t->getpgid ()) &&
|
||||
(t->getpgid () != myself->pid ||
|
||||
(GetTickCount () - t->last_ctrl_c) < MIN_CTRL_C_SLOP))
|
||||
return TRUE;
|
||||
else
|
||||
/* Otherwise we just send a SIGINT to the process group and return TRUE (to indicate
|
||||
|
|
|
@ -150,11 +150,11 @@ private:
|
|||
|
||||
unsigned long namehash; /* hashed filename, used as inode num */
|
||||
|
||||
protected:
|
||||
/* Full unix path name of this file */
|
||||
/* File open flags from open () and fcntl () calls */
|
||||
int openflags;
|
||||
|
||||
protected:
|
||||
char *rabuf; /* used for crlf conversion in text files */
|
||||
size_t ralen;
|
||||
size_t raixget;
|
||||
|
|
|
@ -595,7 +595,7 @@ fhandler_console::dup (fhandler_base *child)
|
|||
{
|
||||
fhandler_console *fhc = (fhandler_console *) child;
|
||||
|
||||
if (!fhc->open (get_name (), get_flags (), 0))
|
||||
if (!fhc->open (get_name (), get_flags () & ~O_NOCTTY, 0))
|
||||
system_printf ("error opening console, %E");
|
||||
|
||||
fhc->default_color = default_color;
|
||||
|
|
|
@ -783,6 +783,7 @@ fhandler_tty_common::dup (fhandler_base *child)
|
|||
fts->tcinit (get_ttyp ());
|
||||
|
||||
attach_tty (ttynum);
|
||||
tc->set_ctty (ttynum, openflags & ~O_NOCTTY);
|
||||
|
||||
HANDLE nh;
|
||||
|
||||
|
|
|
@ -19,9 +19,3 @@ unsigned _cygwin_S_IXGRP = S_IXGRP;
|
|||
unsigned _cygwin_S_IXOTH = S_IXOTH;
|
||||
unsigned _cygwin_X_OK = X_OK;
|
||||
};
|
||||
|
||||
extern int __declspec (dllimport) _check_for_executable;
|
||||
struct _cygwin_bob__
|
||||
{
|
||||
_cygwin_bob__ () {_check_for_executable = 1;}
|
||||
} _cygwin_dummy_bob__;
|
||||
|
|
|
@ -1429,7 +1429,7 @@ tzsetwall P((void))
|
|||
}
|
||||
}
|
||||
#endif /* defined ALL_STATE */
|
||||
#ifdef _WIN32
|
||||
#if defined (_WIN32) || defined (__CYGWIN__)
|
||||
#define is_upper(c) ((unsigned)(c) - 'A' <= 26)
|
||||
{
|
||||
TIME_ZONE_INFORMATION tz;
|
||||
|
|
|
@ -386,6 +386,9 @@ path_conv::check (const char *src, unsigned opt,
|
|||
MALLOC_CHECK;
|
||||
assert (src);
|
||||
char *p = strrchr (src, '/');
|
||||
/* Detect if the user was looking for a directory. We have to strip the
|
||||
trailing slash initially and add it back on at the end due to Windows
|
||||
brain damage. */
|
||||
if (p)
|
||||
{
|
||||
if (p[1] == '\0' || strcmp (p, "/.") == 0)
|
||||
|
@ -434,9 +437,11 @@ path_conv::check (const char *src, unsigned opt,
|
|||
full_path = this->path;
|
||||
}
|
||||
|
||||
/* Convert to native path spec sans symbolic link info. */
|
||||
error = mount_table->conv_to_win32_path (path_copy, full_path, devn,
|
||||
unit, &sym.pflags);
|
||||
|
||||
/* devn should not be a device. If it is, then stop parsing now. */
|
||||
if (devn != FH_BAD)
|
||||
{
|
||||
fileattr = 0;
|
||||
|
@ -453,7 +458,10 @@ path_conv::check (const char *src, unsigned opt,
|
|||
*tail = '\0';
|
||||
|
||||
if (full_path[0] && full_path[1] == ':' && full_path[2] == '\0')
|
||||
strcat (full_path, "\\");
|
||||
{
|
||||
full_path[2] = '\\';
|
||||
full_path[3] = '\0';
|
||||
}
|
||||
|
||||
if ((opt & PC_SYM_IGNORE) && pcheck_case == PCHECK_RELAXED)
|
||||
{
|
||||
|
@ -529,13 +537,16 @@ path_conv::check (const char *src, unsigned opt,
|
|||
break;
|
||||
}
|
||||
/* No existing file found. */
|
||||
|
||||
}
|
||||
|
||||
/* Find the "tail" of the path, e.g. in '/for/bar/baz',
|
||||
/baz is the tail. */
|
||||
char *newtail = strrchr (path_copy, '/');
|
||||
if (tail != path_end)
|
||||
*tail = '/';
|
||||
|
||||
/* Exit loop if there is no tail or we are at the
|
||||
beginning of a UNC path */
|
||||
if (!newtail || newtail == path_copy || (newtail == path_copy + 1 && newtail[-1] == '/'))
|
||||
goto out; // all done
|
||||
|
||||
|
@ -556,6 +567,9 @@ path_conv::check (const char *src, unsigned opt,
|
|||
|
||||
MALLOC_CHECK;
|
||||
|
||||
/* The tail is pointing at a null pointer. Increment it and get the length.
|
||||
If the tail was empty then this increment will end up pointing to the extra
|
||||
\0 added to path_copy above. */
|
||||
int taillen = strlen (++tail);
|
||||
int buflen = strlen (sym.contents);
|
||||
if (buflen + taillen > MAX_PATH)
|
||||
|
@ -565,24 +579,32 @@ path_conv::check (const char *src, unsigned opt,
|
|||
return;
|
||||
}
|
||||
|
||||
/* Strip off current directory component since this is the part that refers
|
||||
to the symbolic link. */
|
||||
if ((p = strrchr (path_copy, '/')) == NULL)
|
||||
p = path_copy;
|
||||
*p = '\0';
|
||||
|
||||
char *headptr;
|
||||
if (isabspath (sym.contents))
|
||||
headptr = tmp_buf;
|
||||
headptr = tmp_buf; /* absolute path */
|
||||
else
|
||||
{
|
||||
/* Copy the first part of the path and point to the end. */
|
||||
strcpy (tmp_buf, path_copy);
|
||||
headptr = strchr (tmp_buf, '\0');
|
||||
}
|
||||
|
||||
/* See if we need to separate first part + symlink contents with a / */
|
||||
if (headptr > tmp_buf && headptr[-1] != '/')
|
||||
*headptr++ = '/';
|
||||
|
||||
/* Copy the symlink contents to the end of tmp_buf.
|
||||
Convert slashes. FIXME? */
|
||||
for (p = sym.contents; *p; p++)
|
||||
*headptr++ = *p == '\\' ? '/' : *p;
|
||||
|
||||
/* Copy any tail component */
|
||||
if (tail >= path_end)
|
||||
*headptr = '\0';
|
||||
else
|
||||
|
@ -591,6 +613,7 @@ path_conv::check (const char *src, unsigned opt,
|
|||
strcpy (headptr, tail);
|
||||
}
|
||||
|
||||
/* Now evaluate everything all over again. */
|
||||
src = tmp_buf;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue