diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog index 41922169b..b81454497 100644 --- a/winsup/cygwin/ChangeLog +++ b/winsup/cygwin/ChangeLog @@ -1,3 +1,9 @@ +2011-11-28 Corinna Vinschen + + * pinfo.cc (pinfo::exit): Call TerminateProcess to avoid potential + busy loop in ntdll.dll when calling ExitProcess. Only call ExitProcess + as a fallback. + 2011-11-27 Christopher Faylor * init.cc (dll_entry): Revert previous change since it caused diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index d3e68bf32..dacf5256e 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -210,6 +210,8 @@ pinfo::exit (DWORD n) if (!self->cygstarted) exitcode = ((exitcode & 0xff) << 8) | ((exitcode >> 8) & 0xff); sigproc_printf ("Calling ExitProcess n %p, exitcode %p", n, exitcode); + if (!TerminateProcess (GetCurrentProcess (), exitcode)) + system_printf ("TerminateProcess failed, %E"); ExitProcess (exitcode); } # undef self