diff options
author | Christopher Faylor <me@cgf.cx> | 2005-03-08 14:31:21 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2005-03-08 14:31:21 +0000 |
commit | efdc312d120a701674cfbf7b45e348b4fcac1c2b (patch) | |
tree | 2a33c2474f3e0672a7ebde2654adf98b78ec4a2e /winsup/cygwin/pinfo.cc | |
parent | d2428633a692d48c4c4c2e4ff677936e2bd612d8 (diff) | |
download | cygnal-efdc312d120a701674cfbf7b45e348b4fcac1c2b.tar.gz cygnal-efdc312d120a701674cfbf7b45e348b4fcac1c2b.tar.bz2 cygnal-efdc312d120a701674cfbf7b45e348b4fcac1c2b.zip |
* 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.cc | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index a7b650a98..5a046f956 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 |