OSDN Git Service

* cygtls.cc (_cygtls::init_exception_handler): Avoid adding our exception
authorcgf <cgf>
Fri, 17 Jul 2009 16:54:21 +0000 (16:54 +0000)
committercgf <cgf>
Fri, 17 Jul 2009 16:54:21 +0000 (16:54 +0000)
handler twice.

winsup/cygwin/ChangeLog
winsup/cygwin/cygtls.cc

index 71dbae4..b1684c6 100644 (file)
@@ -1,3 +1,8 @@
+2009-07-17  Christopher Faylor  <me+cygwin@cgf.cx>
+
+       * cygtls.cc (_cygtls::init_exception_handler): Avoid adding our
+       exception handler twice.
+
 2009-07-17  Corinna Vinschen  <corinna@vinschen.de>
 
        * syscalls.cc (unlink_nt): Just return when a sharing violation
index 1b1ca11..f474d9b 100644 (file)
@@ -228,6 +228,9 @@ extern exception_list *_except_list asm ("%fs:0");
 void
 _cygtls::init_exception_handler (exception_handler *eh)
 {
+  for (exception_list *e = _except_list; e->prev != NULL && e->prev != (exception_list *)-1; e = e->prev)
+    if (e == &el)
+      return;
   el.handler = eh;
   /* Apparently Windows stores some information about an exception and tries
      to figure out if the SEH which returned 0 last time actually solved the