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:
Diffstat (limited to 'winsup/cygwin/init.cc')
-rw-r--r--winsup/cygwin/init.cc9
1 files changed, 7 insertions, 2 deletions
diff --git a/winsup/cygwin/init.cc b/winsup/cygwin/init.cc
index 7417f05b4..ad4761820 100644
--- a/winsup/cygwin/init.cc
+++ b/winsup/cygwin/init.cc
@@ -111,6 +111,7 @@ extern "C" int WINAPI
dll_entry (HANDLE h, DWORD reason, void *static_load)
{
BOOL is_64bit_machine = FALSE;
+ extern HANDLE hExeced;
switch (reason)
{
@@ -127,8 +128,12 @@ dll_entry (HANDLE h, DWORD reason, void *static_load)
dll_crt0_0 ();
break;
case DLL_PROCESS_DETACH:
- if (myself && myself->exitcode == EXITCODE_UNSET)
- myself->exitcode = 1 << 8;
+ if (myself)
+ {
+ if (!hExeced && myself->exitcode == EXITCODE_UNSET)
+ myself->exitcode = 1 << 8;
+ myself.release ();
+ }
break;
case DLL_THREAD_ATTACH:
munge_threadfunc ();