Welcome to mirror list, hosted at ThFree Co, Russian Federation.

cygwin.com/git/newlib-cygwin.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2006-03-29 10:35:25 +0400
committerChristopher Faylor <me@cgf.cx>2006-03-29 10:35:25 +0400
commit12b33712894f9c61732ef686d81248fc607b6766 (patch)
tree67847a11d95c794dd7d91e58c366c2b521de701d /winsup/cygwin/sigproc.cc
parentcdc2256b769c1183177bf92cb22c34311ce8e6de (diff)
* dcrt0.cc (child_info_fork::handle_fork): Set uid/gid in myself so that it can
be used by subsequent startup functions. (dll_crt0_0): Issue a warning if DuplicateTokenEx fails and DEBUGGING. (dll_crt0_1): Move user_data->{resourcelocks,threadinterface} initialization here from dll_crt0_0. * fork.cc (frok::child): Tell wait_for_sigthread that this is fork. (frok::parent): Only initialize start_time once. Tighten time when we're "deimpersonated". * sigproc.cc (signal_fixup_after_exec): Rework (futiley) sa_buf stuff. Add debugging output. (wait_for_sigthread): Accept an argument which illustrates whether we are forked or not. (wait_sig): Avoid using myself pointer. * winsup.h ((wait_for_sigthread): Reflect change to argument.
Diffstat (limited to 'winsup/cygwin/sigproc.cc')
-rw-r--r--winsup/cygwin/sigproc.cc17
1 files changed, 8 insertions, 9 deletions
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index 02f5387d0..7d22af3be 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -134,11 +134,12 @@ signal_fixup_after_exec ()
}
void __stdcall
-wait_for_sigthread ()
+wait_for_sigthread (bool forked)
{
- PSECURITY_ATTRIBUTES sa_buf = (PSECURITY_ATTRIBUTES) alloca (1024);
- if (!CreatePipe (&my_readsig, &my_sendsig, sec_user_nih (sa_buf), 0))
- api_fatal ("couldn't create signal pipe, %E");
+ char char_sa_buf[1024];
+ PSECURITY_ATTRIBUTES sa_buf = sec_user_nih ((PSECURITY_ATTRIBUTES) char_sa_buf);
+ if (!CreatePipe (&my_readsig, &my_sendsig, sa_buf, 0))
+ api_fatal ("couldn't create signal pipe%s, %E", forked ? " for forked process" : "");
ProtectHandle (my_readsig);
myself->sendsig = my_sendsig;
@@ -151,6 +152,7 @@ wait_for_sigthread ()
wait_sig_inited = NULL;
ForceCloseHandle1 (hsig_inited, wait_sig_inited);
SetEvent (sigCONT);
+ sigproc_printf ("process/signal handling enabled, state %p", myself->process_state);
}
/* Get the sync_proc_subproc muto to control access to
@@ -497,8 +499,6 @@ sigproc_init ()
hwait_sig = new cygthread (wait_sig, 0, cygself, "sig");
hwait_sig->zap_h ();
-
- sigproc_printf ("process/signal handling enabled, state %p", myself->process_state);
}
/* Called on process termination to terminate signal and process threads.
@@ -1134,13 +1134,12 @@ wait_sig (VOID *)
sigCONT = CreateEvent (&sec_none_nih, FALSE, FALSE, NULL);
- sigproc_printf ("myself->dwProcessId %u", myself->dwProcessId);
SetEvent (wait_sig_inited);
_sig_tls = &_my_tls;
_sig_tls->init_threadlist_exceptions ();
- debug_printf ("entering ReadFile loop, my_readsig %p, myself->sendsig %p",
- my_readsig, myself->sendsig);
+ sigproc_printf ("entering ReadFile loop, my_readsig %p, my_sendsig %p",
+ my_readsig, my_sendsig);
sigpacket pack;
pack.si.si_signo = __SIGHOLD;