summaryrefslogtreecommitdiffstats
path: root/winsup/cygwin/spawn.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-03-02 15:32:34 +0000
committerChristopher Faylor <me@cgf.cx>2005-03-02 15:32:34 +0000
commitd83eb0c7d0c4c58ade045e1ee44a6f5ade83e964 (patch)
tree27af42ba1d3dfb216558cda04cbaaee3cae66460 /winsup/cygwin/spawn.cc
parente04c777cc6721bf37f4747814b98baca9d269fc4 (diff)
downloadcygnal-d83eb0c7d0c4c58ade045e1ee44a6f5ade83e964.tar.gz
cygnal-d83eb0c7d0c4c58ade045e1ee44a6f5ade83e964.tar.bz2
cygnal-d83eb0c7d0c4c58ade045e1ee44a6f5ade83e964.zip
* spawn.cc (do_cleanup): Properly restore SIGINT/SIGQUIT even if they had
previously been SIG_DFL.
Diffstat (limited to 'winsup/cygwin/spawn.cc')
-rw-r--r--winsup/cygwin/spawn.cc12
1 files changed, 6 insertions, 6 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc
index cfd89a840..38a2a1e9a 100644
--- a/winsup/cygwin/spawn.cc
+++ b/winsup/cygwin/spawn.cc
@@ -332,12 +332,12 @@ static void
do_cleanup (void *args)
{
# define cleanup ((pthread_cleanup *) args)
- if (cleanup->oldint)
- signal (SIGINT, cleanup->oldint);
- if (cleanup->oldquit)
- signal (SIGQUIT, cleanup->oldquit);
if (cleanup->oldmask != (sigset_t) -1)
- sigprocmask (SIG_SETMASK, &(cleanup->oldmask), NULL);
+ {
+ signal (SIGINT, cleanup->oldint);
+ signal (SIGQUIT, cleanup->oldquit);
+ sigprocmask (SIG_SETMASK, &(cleanup->oldmask), NULL);
+ }
# undef cleanup
}
@@ -755,7 +755,6 @@ spawn_guts (const char * prog_arg, const char *const *argv,
int res;
pthread_cleanup cleanup;
- pthread_cleanup_push (do_cleanup, (void *) &cleanup);
if (mode == _P_SYSTEM)
{
sigset_t child_block;
@@ -765,6 +764,7 @@ spawn_guts (const char * prog_arg, const char *const *argv,
sigaddset (&child_block, SIGCHLD);
(void) sigprocmask (SIG_BLOCK, &child_block, &cleanup.oldmask);
}
+ pthread_cleanup_push (do_cleanup, (void *) &cleanup);
/* Fixup the parent data structures if needed and resume the child's
main thread. */