From 837528aa51777d445e6fd5b6f4da4c3d99b82592 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 1 Sep 2000 21:04:34 +0000 Subject: [PATCH] * sigproc.cc (sigproc_init): Create wait_sig_inited without auto-reset to avoid potential races. (init_child_info): Avoid unneeded test. --- winsup/cygwin/ChangeLog | 6 ++++++ winsup/cygwin/sigproc.cc | 4 ++-- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index f9e14a7c1..2be8e4fb4 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +Fri Sep 1 16:57:44 2000 Christopher Faylor + + * sigproc.cc (sigproc_init): Create wait_sig_inited without auto-reset + to avoid potential races. + (init_child_info): Avoid unneeded test. + Fri Sep 1 16:51:26 2000 Christopher Faylor * sigproc.cc (proc_info): Rename proc_exists which takes a pid to diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index 55cde230e..30976b62a 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -610,7 +610,7 @@ sig_dispatch_pending (int justwake) void __stdcall sigproc_init () { - wait_sig_inited = CreateEvent (&sec_none_nih, FALSE, FALSE, NULL); + wait_sig_inited = CreateEvent (&sec_none_nih, TRUE, FALSE, NULL); ProtectHandle (wait_sig_inited); /* local event signaled when main thread has been dispatched @@ -914,7 +914,7 @@ init_child_info (DWORD chtype, child_info *ch, pid_t pid, HANDLE subproc_ready) ch->subproc_ready = subproc_ready; if (chtype != PROC_EXEC || !parent_alive) ch->parent_alive = hwait_subproc; - else if (parent_alive) + else DuplicateHandle (hMainProc, parent_alive, hMainProc, &ch->parent_alive, 0, 1, DUPLICATE_SAME_ACCESS); }