summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2012-08-15 16:35:00 +0000
committerChristopher Faylor <me@cgf.cx>2012-08-15 16:35:00 +0000
commitd57a4725b1dde16e292ed7a9898752b4e2277766 (patch)
treea3596c31e2702e4fad52bcd27bf8ed02a27a87f0
parent0123506d2df6775cc3251f33f3983cd32103c663 (diff)
downloadcygnal-d57a4725b1dde16e292ed7a9898752b4e2277766.tar.gz
cygnal-d57a4725b1dde16e292ed7a9898752b4e2277766.tar.bz2
cygnal-d57a4725b1dde16e292ed7a9898752b4e2277766.zip
* exceptions.cc (sigdelayed): Move declaration to sigproc.h.
* sigproc.h (sigdelayed): Make symbol globally available. * gendef (sigdelayed): Specifically zero incyg and stacklock. * signal.cc (sigwaitinfo): Lock _my_tls and try harder to clean up signal information.
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/exceptions.cc2
-rwxr-xr-xwinsup/cygwin/gendef5
-rw-r--r--winsup/cygwin/signal.cc6
-rw-r--r--winsup/cygwin/sigproc.h2
5 files changed, 18 insertions, 5 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index ddf98d256..d93d2ee5a 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,13 @@
2012-08-15 Christopher Faylor <me.cygwin2012@cgf.cx>
+ * exceptions.cc (sigdelayed): Move declaration to sigproc.h.
+ * sigproc.h (sigdelayed): Make symbol globally available.
+ * gendef (sigdelayed): Specifically zero incyg and stacklock.
+ * signal.cc (sigwaitinfo): Lock _my_tls and try harder to clean up
+ signal information.
+
+2012-08-15 Christopher Faylor <me.cygwin2012@cgf.cx>
+
* pinfo.cc (_pinfo::exists): Don't consider an execed process to exist.
2012-08-14 Corinna Vinschen <corinna@vinschen.de>
diff --git a/winsup/cygwin/exceptions.cc b/winsup/cygwin/exceptions.cc
index 649574fc2..8df69f29d 100644
--- a/winsup/cygwin/exceptions.cc
+++ b/winsup/cygwin/exceptions.cc
@@ -37,8 +37,6 @@ details. */
char debugger_command[2 * NT_MAX_PATH + 20];
-extern "C" void sigdelayed ();
-
static BOOL WINAPI ctrl_c_handler (DWORD);
/* This is set to indicate that we have already exited. */
diff --git a/winsup/cygwin/gendef b/winsup/cygwin/gendef
index 5cc06f76c..ddffe5800 100755
--- a/winsup/cygwin/gendef
+++ b/winsup/cygwin/gendef
@@ -196,8 +196,9 @@ _sigdelayed:
xorl %ebp,%ebp
xchgl %ebp,-4(%eax) # get return address from signal stack
xchgl %ebp,28(%esp) # store real return address
-leave: decl $tls::incyg(%ebx)
- decl $tls::stacklock(%ebx) # unlock
+leave: xorl %eax,%eax
+ movl %eax,$tls::incyg(%ebx)
+ movl %eax,$tls::stacklock(%ebx) # unlock
popl %eax
popl %ebx
diff --git a/winsup/cygwin/signal.cc b/winsup/cygwin/signal.cc
index f3a3a3a07..b83358812 100644
--- a/winsup/cygwin/signal.cc
+++ b/winsup/cygwin/signal.cc
@@ -590,10 +590,14 @@ sigwaitinfo (const sigset_t *set, siginfo_t *info)
}
else
{
+ _my_tls.lock ();
if (info)
*info = _my_tls.infodata;
res = _my_tls.infodata.si_signo;
- InterlockedExchange ((LONG *) &_my_tls.sig, (LONG) 0);
+ _my_tls.sig = 0;
+ if (_my_tls.retaddr () == (__stack_t) sigdelayed)
+ _my_tls.pop ();
+ _my_tls.unlock ();
}
break;
default:
diff --git a/winsup/cygwin/sigproc.h b/winsup/cygwin/sigproc.h
index 06ebd68d8..6e6f3f46f 100644
--- a/winsup/cygwin/sigproc.h
+++ b/winsup/cygwin/sigproc.h
@@ -86,6 +86,8 @@ void __stdcall sigalloc ();
int kill_pgrp (pid_t, siginfo_t&);
int killsys (pid_t, int);
+extern "C" void sigdelayed ();
+
extern char myself_nowait_dummy[];
extern struct sigaction *global_sigs;