From 150f3bd16864bfb1a8ab10904924fcee7feeb621 Mon Sep 17 00:00:00 2001 From: Christopher Faylor Date: Fri, 16 Sep 2005 01:47:09 +0000 Subject: * sigproc.cc (no_signals_available): Return true if sending to self from the signal thread. (wait_sig): Correct so that WaitForSingleObject is called when hMainThread is != 0, rather than the reverse. * cygheap.cc (cygheap_fixup_in_child): Clarify potential error message. * fork.cc (fork_copy): Cosmetic change. --- winsup/cygwin/ChangeLog | 11 +++++++++++ winsup/cygwin/cygheap.cc | 2 +- winsup/cygwin/fork.cc | 2 +- winsup/cygwin/sigproc.cc | 4 ++-- winsup/cygwin/spawn.cc | 11 +---------- 5 files changed, 16 insertions(+), 14 deletions(-) (limited to 'winsup/cygwin') diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 2ab99a577..6212001dd 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,14 @@ +2005-09-15 Christopher Faylor + + * sigproc.cc (no_signals_available): Return true if sending to self + from the signal thread. + (wait_sig): Correct so that WaitForSingleObject is called when + hMainThread is != 0, rather than the reverse. + + * cygheap.cc (cygheap_fixup_in_child): Clarify potential error message. + + * fork.cc (fork_copy): Cosmetic change. + 2005-09-15 Christopher Faylor * sigproc.cc (wait_sig): Reorganize exit case so that ExitProcess is diff --git a/winsup/cygwin/cygheap.cc b/winsup/cygwin/cygheap.cc index 6cbdf6ef7..fff2ad0d2 100644 --- a/winsup/cygwin/cygheap.cc +++ b/winsup/cygwin/cygheap.cc @@ -59,7 +59,7 @@ cygheap_fixup_in_child (bool execed) cygheap_max = child_proc_info->cygheap; cygheap = (init_cygheap *) cygheap_max; _csbrk ((char *) child_proc_info->cygheap_max - (char *) cygheap); - child_copy (child_proc_info->parent, child_proc_info->dwProcessId, "cygheap", cygheap, cygheap_max); + child_copy (child_proc_info->parent, child_proc_info->dwProcessId, "cygheap for exec", cygheap, cygheap_max); cygheap_init (); debug_fixup_after_fork_exec (); diff --git a/winsup/cygwin/fork.cc b/winsup/cygwin/fork.cc index f16eabc32..92e27aa78 100644 --- a/winsup/cygwin/fork.cc +++ b/winsup/cygwin/fork.cc @@ -62,7 +62,7 @@ stack_base (child_info_fork &ch) The result is a boolean indicating success. */ static int -fork_copy (PROCESS_INFORMATION &pi, const char *what, ...) +fork_copy (PROCESS_INFORMATION& pi, const char *what, ...) { va_list args; char *low; diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc index ede777fb8..af87e1e02 100644 --- a/winsup/cygwin/sigproc.cc +++ b/winsup/cygwin/sigproc.cc @@ -38,7 +38,7 @@ details. */ #define WSSC 60000 // Wait for signal completion #define WPSP 40000 // Wait for proc_subproc mutex -#define no_signals_available() (!hwait_sig || (myself->exitcode & EXITCODE_SET) && !my_sendsig) +#define no_signals_available() (!hwait_sig || (myself->exitcode & EXITCODE_SET) || !my_sendsig || &_my_tls == _sig_tls) #define NPROCS 256 @@ -1127,7 +1127,7 @@ wait_sig (VOID *self) HANDLE h = hMainThread; my_sendsig = hMainThread = NULL; - DWORD res = h ? WAIT_OBJECT_0 : WaitForSingleObject (h, INFINITE); + DWORD res = !h ? WAIT_OBJECT_0 : WaitForSingleObject (h, INFINITE); DWORD exitcode = 1; diff --git a/winsup/cygwin/spawn.cc b/winsup/cygwin/spawn.cc index 73c148e24..ffafa8f7c 100644 --- a/winsup/cygwin/spawn.cc +++ b/winsup/cygwin/spawn.cc @@ -1020,15 +1020,6 @@ av::fixup (child_info_types chtype, const char *prog_arg, path_conv& real_path, bool exeext = strcasematch (ext, ".exe"); if (exeext && real_path.iscygexec ()) return 0; - char *buf = NULL; - myfault efault; - if (efault.faulted ()) - { - if (buf) - UnmapViewOfFile (buf); - real_path.set_cygexec (false); - return 0; - } while (1) { HANDLE h = CreateFile (real_path, GENERIC_READ, @@ -1042,7 +1033,7 @@ av::fixup (child_info_types chtype, const char *prog_arg, path_conv& real_path, CloseHandle (h); if (!hm) goto err; - buf = (char *) MapViewOfFile(hm, FILE_MAP_READ, 0, 0, 0); + char *buf = (char *) MapViewOfFile(hm, FILE_MAP_READ, 0, 0, 0); CloseHandle (hm); if (!buf) goto err; -- cgit v1.2.3