diff options
author | Charles Wilson <cygwin@cwilson.fastmail.fm> | 2009-10-06 21:51:17 +0000 |
---|---|---|
committer | Charles Wilson <cygwin@cwilson.fastmail.fm> | 2009-10-06 21:51:17 +0000 |
commit | c8ee587a8e8ebcc06ed49b771c759b57b19a1aec (patch) | |
tree | 735e3a5f5bb4895b3e9b57b7b283d559604a3160 /winsup/cygwin/pinfo.cc | |
parent | 960bdc0e74168138b71b8b2e5e9659be64bce3f0 (diff) | |
download | newlib-c8ee587a8e8ebcc06ed49b771c759b57b19a1aec.zip newlib-c8ee587a8e8ebcc06ed49b771c759b57b19a1aec.tar.gz newlib-c8ee587a8e8ebcc06ed49b771c759b57b19a1aec.tar.bz2 |
Add cygwin wrapper for ExitProcess and TerminateProcess.
Diffstat (limited to 'winsup/cygwin/pinfo.cc')
-rw-r--r-- | winsup/cygwin/pinfo.cc | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/winsup/cygwin/pinfo.cc b/winsup/cygwin/pinfo.cc index ee11d20..ba17f23 100644 --- a/winsup/cygwin/pinfo.cc +++ b/winsup/cygwin/pinfo.cc @@ -136,6 +136,14 @@ status_exit (DWORD x) # define self (*this) void +pinfo::set_exit_code (DWORD x) +{ + if (x >= 0xc0000000UL) + x = status_exit (x); + self->exitcode = EXITCODE_SET | (sigExeced ?: (x & 0xff) << 8); +} + +void pinfo::maybe_set_exit_code_from_windows () { DWORD x = 0xdeadbeef; @@ -147,9 +155,7 @@ pinfo::maybe_set_exit_code_from_windows () process hasn't quite exited after closing pipe */ GetExitCodeProcess (hProcess, &x); - if (x >= 0xc0000000UL) - x = status_exit (x); - self->exitcode = EXITCODE_SET | (sigExeced ?: (x & 0xff) << 8); + set_exit_code (x); } sigproc_printf ("pid %d, exit value - old %p, windows %p, cygwin %p", self->pid, oexitcode, x, self->exitcode); |