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>2004-12-27 05:13:30 +0300
committerChristopher Faylor <me@cgf.cx>2004-12-27 05:13:30 +0300
commit933673e83be8bebaf0c3b7646c6119d1acd5fc05 (patch)
treee50a2ef4bcb1833eb8fb520805ed20aa60840687 /winsup/cygwin
parent445d5ce8fcffed71f4349c723b707dc779fe1cc2 (diff)
* init.cc (dll_entry): Previous code reversion was ill-advised. Revert it.
* sigproc.cc (child_info::sync): Ditto. * pinfo.cc (_pinfo::exit): Don't set myself.procinfo to NULL since it is no longer required.
Diffstat (limited to 'winsup/cygwin')
-rw-r--r--winsup/cygwin/ChangeLog8
-rw-r--r--winsup/cygwin/init.cc3
-rw-r--r--winsup/cygwin/pinfo.cc1
-rw-r--r--winsup/cygwin/sigproc.cc7
4 files changed, 18 insertions, 1 deletions
diff --git a/winsup/cygwin/ChangeLog b/winsup/cygwin/ChangeLog
index be0e65fed..76b96ebd9 100644
--- a/winsup/cygwin/ChangeLog
+++ b/winsup/cygwin/ChangeLog
@@ -1,5 +1,13 @@
2004-12-26 Christopher Faylor <cgf@timesys.com>
+ * init.cc (dll_entry): Previous code reversion was ill-advised. Revert
+ it.
+ * sigproc.cc (child_info::sync): Ditto.
+ * pinfo.cc (_pinfo::exit): Don't set myself.procinfo to NULL since it
+ is no longer required.
+
+2004-12-26 Christopher Faylor <cgf@timesys.com>
+
* init.cc (dll_entry): Remove exit code setting.
* pinfo.cc (pinfo::init): Initialize exitcode to unset state rather
than SIGTERM.
diff --git a/winsup/cygwin/init.cc b/winsup/cygwin/init.cc
index 7ba0dc348..7417f05b4 100644
--- a/winsup/cygwin/init.cc
+++ b/winsup/cygwin/init.cc
@@ -13,6 +13,7 @@ details. */
#include "thread.h"
#include "perprocess.h"
#include "cygtls.h"
+#include "pinfo.h"
int NO_COPY dynamically_loaded;
static char *search_for = (char *) cygthread::stub;
@@ -126,6 +127,8 @@ 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;
break;
case DLL_THREAD_ATTACH:
munge_threadfunc ();
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index 24167b90d..5d56fc474 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -132,7 +132,6 @@ _pinfo::exit (UINT n, bool norecord)
sigproc_printf ("Calling ExitProcess %d", n);
_my_tls.stacklock = 0;
_my_tls.stackptr = _my_tls.stack;
- myself.procinfo = NULL; // This breaks the abstraction a little doesn't it?
ExitProcess (exitcode);
}
diff --git a/winsup/cygwin/sigproc.cc b/winsup/cygwin/sigproc.cc
index db4997b88..b5a281530 100644
--- a/winsup/cygwin/sigproc.cc
+++ b/winsup/cygwin/sigproc.cc
@@ -798,6 +798,13 @@ child_info::sync (pinfo& vchild, DWORD howlong)
case WAIT_OBJECT_0 + 1:
if (WaitForSingleObject (subproc_ready, 0) == WAIT_OBJECT_0)
sigproc_printf ("should never happen. noticed subproc_ready after process exit");
+ else
+ {
+ DWORD exitcode = 0;
+ (void) GetExitCodeProcess (vchild.hProcess, &exitcode);
+ vchild->exitcode = (exitcode & 0xff) << 8;
+ sigproc_printf ("non-cygwin exit value is %p", exitcode);
+ }
res = false;
break;
default: