* exceptions.cc (call_signal_handler_now): Add additional guard against
inappropriately calling signal handler. * syscalls.cc (_read): Reset errno if not exiting due to signal.
This commit is contained in:
parent
ff6e295ebf
commit
aed6988a36
@ -1,3 +1,9 @@
|
|||||||
|
Wed Sep 12 01:03:36 2001 Christopher Faylor <cgf@cygnus.com>
|
||||||
|
|
||||||
|
* exceptions.cc (call_signal_handler_now): Add additional guard against
|
||||||
|
inappropriately calling signal handler.
|
||||||
|
* syscalls.cc (_read): Reset errno if not exiting due to signal.
|
||||||
|
|
||||||
Wed Sep 12 13:03:00 2001 Robert Collins <rbtcollins@hotmail.com>
|
Wed Sep 12 13:03:00 2001 Robert Collins <rbtcollins@hotmail.com>
|
||||||
|
|
||||||
* autoload.cc (LoadDLLfuncEx): Auto load TryEnterCriticalSection - it's
|
* autoload.cc (LoadDLLfuncEx): Auto load TryEnterCriticalSection - it's
|
||||||
|
@ -1127,6 +1127,12 @@ extern "C" {
|
|||||||
static int __stdcall
|
static int __stdcall
|
||||||
call_signal_handler_now ()
|
call_signal_handler_now ()
|
||||||
{
|
{
|
||||||
|
if (!sigsave.sig)
|
||||||
|
{
|
||||||
|
sigproc_printf ("call_signal_handler_now called when no signal active");
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
int sa_flags = sigsave.sa_flags;
|
int sa_flags = sigsave.sa_flags;
|
||||||
sigproc_printf ("sa_flags %p", sa_flags);
|
sigproc_printf ("sa_flags %p", sa_flags);
|
||||||
*sigsave.retaddr_on_stack = sigsave.retaddr;
|
*sigsave.retaddr_on_stack = sigsave.retaddr;
|
||||||
|
@ -275,6 +275,7 @@ _read (int fd, void *ptr, size_t len)
|
|||||||
int res;
|
int res;
|
||||||
fhandler_base *fh;
|
fhandler_base *fh;
|
||||||
extern int sigcatchers;
|
extern int sigcatchers;
|
||||||
|
int e = get_errno ();
|
||||||
|
|
||||||
while (1)
|
while (1)
|
||||||
{
|
{
|
||||||
@ -318,6 +319,7 @@ _read (int fd, void *ptr, size_t len)
|
|||||||
out:
|
out:
|
||||||
if (res >= 0 || get_errno () != EINTR || !thisframe.call_signal_handler ())
|
if (res >= 0 || get_errno () != EINTR || !thisframe.call_signal_handler ())
|
||||||
break;
|
break;
|
||||||
|
set_errno (e);
|
||||||
}
|
}
|
||||||
|
|
||||||
syscall_printf ("%d = read (%d<%s>, %p, %d), bin %d, errno %d", res, fd, fh->get_name (),
|
syscall_printf ("%d = read (%d<%s>, %p, %d), bin %d, errno %d", res, fd, fh->get_name (),
|
||||||
|
Loading…
x
Reference in New Issue
Block a user