OSDN Git Service

* exceptions.cc (call_signal_handler_now): Add additional guard against
authorcgf <cgf>
Wed, 12 Sep 2001 05:09:23 +0000 (05:09 +0000)
committercgf <cgf>
Wed, 12 Sep 2001 05:09:23 +0000 (05:09 +0000)
inappropriately calling signal handler.
* syscalls.cc (_read): Reset errno if not exiting due to signal.

winsup/cygwin/ChangeLog
winsup/cygwin/exceptions.cc
winsup/cygwin/syscalls.cc

index abaf889..ee21390 100644 (file)
@@ -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>
 
        * autoload.cc (LoadDLLfuncEx): Auto load TryEnterCriticalSection - it's
index bf4a444..37607cd 100644 (file)
@@ -1127,6 +1127,12 @@ extern "C" {
 static int __stdcall
 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;
   sigproc_printf ("sa_flags %p", sa_flags);
   *sigsave.retaddr_on_stack = sigsave.retaddr;
index 3359c35..e9ee64d 100644 (file)
@@ -275,6 +275,7 @@ _read (int fd, void *ptr, size_t len)
   int res;
   fhandler_base *fh;
   extern int sigcatchers;
+  int e = get_errno ();
 
   while (1)
     {
@@ -318,6 +319,7 @@ _read (int fd, void *ptr, size_t len)
     out:
       if (res >= 0 || get_errno () != EINTR || !thisframe.call_signal_handler ())
        break;
+      set_errno (e);
     }
 
   syscall_printf ("%d = read (%d<%s>, %p, %d), bin %d, errno %d", res, fd, fh->get_name (),