aboutsummaryrefslogtreecommitdiff
path: root/winsup/cygwin/pinfo.cc
diff options
context:
space:
mode:
authorChristopher Faylor <me@cgf.cx>2005-03-08 14:31:21 +0000
committerChristopher Faylor <me@cgf.cx>2005-03-08 14:31:21 +0000
commitefdc312d120a701674cfbf7b45e348b4fcac1c2b (patch)
tree2a33c2474f3e0672a7ebde2654adf98b78ec4a2e /winsup/cygwin/pinfo.cc
parentd2428633a692d48c4c4c2e4ff677936e2bd612d8 (diff)
downloadnewlib-efdc312d120a701674cfbf7b45e348b4fcac1c2b.zip
newlib-efdc312d120a701674cfbf7b45e348b4fcac1c2b.tar.gz
newlib-efdc312d120a701674cfbf7b45e348b4fcac1c2b.tar.bz2
* pinfo.cc (pinfo::exit): Right shift exit value by eight when not started in a
cygwin environment.
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r--winsup/cygwin/pinfo.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc
index a7b650a..5a046f9 100644
--- a/winsup/cygwin/pinfo.cc
+++ b/winsup/cygwin/pinfo.cc
@@ -158,14 +158,16 @@ pinfo::exit (DWORD n)
self->alert_parent (0); /* Shave a little time by telling our
parent that we have now exited. */
}
- int exitcode = self->exitcode;
+ int exitcode = self->exitcode & 0xffff;
+ if (!self->cygstarted)
+ exitcode >>= 8;
release ();
_my_tls.stacklock = 0;
_my_tls.stackptr = _my_tls.stack;
sigproc_printf ("Calling ExitProcess hProcess %p, n %p, exitcode %p",
hProcess, n, exitcode);
- ExitProcess (exitcode & 0xffff);
+ ExitProcess (exitcode);
}
# undef self