diff options
author | Christopher Faylor <me@cgf.cx> | 2003-09-25 13:49:21 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2003-09-25 13:49:21 +0000 |
commit | b498c877a1e89bcae895f284ba4a7778419d6ece (patch) | |
tree | d3e60bb54a59303ef657cf210d660599c7ffb00b /winsup/cygwin/spawn.cc | |
parent | cb86a98b3be2bdde180beee19006c81b1ad21f40 (diff) | |
download | cygnal-b498c877a1e89bcae895f284ba4a7778419d6ece.tar.gz cygnal-b498c877a1e89bcae895f284ba4a7778419d6ece.tar.bz2 cygnal-b498c877a1e89bcae895f284ba4a7778419d6ece.zip |
* spawn.cc (spawn_guts): Move system signal handling stuff after CreateProcess
error check.
Diffstat (limited to 'winsup/cygwin/spawn.cc')
-rw-r--r-- | winsup/cygwin/spawn.cc | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 422774b1f..b33966064 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -709,21 +709,6 @@ spawn_guts (const char * prog_arg, const char *const *argv, &pi); } - /* FIXME: There is a small race here */ - - DWORD res; - pthread_cleanup cleanup; - pthread_cleanup_push (do_cleanup, (void *) &cleanup); - if (mode == _P_SYSTEM) - { - sigset_t child_block; - cleanup.oldint = signal (SIGINT, SIG_IGN); - cleanup.oldquit = signal (SIGQUIT, SIG_IGN); - sigemptyset (&child_block); - sigaddset (&child_block, SIGCHLD); - (void) sigprocmask (SIG_BLOCK, &child_block, &cleanup.oldmask); - } - /* Restore impersonation. In case of _P_OVERLAY this isn't allowed since it would overwrite child data. */ if (mode != _P_OVERLAY) @@ -747,6 +732,21 @@ spawn_guts (const char * prog_arg, const char *const *argv, return -1; } + /* FIXME: There is a small race here */ + + DWORD res; + pthread_cleanup cleanup; + pthread_cleanup_push (do_cleanup, (void *) &cleanup); + if (mode == _P_SYSTEM) + { + sigset_t child_block; + cleanup.oldint = signal (SIGINT, SIG_IGN); + cleanup.oldquit = signal (SIGQUIT, SIG_IGN); + sigemptyset (&child_block); + sigaddset (&child_block, SIGCHLD); + (void) sigprocmask (SIG_BLOCK, &child_block, &cleanup.oldmask); + } + /* Fixup the parent datastructure if needed and resume the child's main thread. */ if (!cygheap->fdtab.need_fixup_before ()) |