diff options
author | Christopher Faylor <me@cgf.cx> | 2012-01-31 18:06:51 +0000 |
---|---|---|
committer | Christopher Faylor <me@cgf.cx> | 2012-01-31 18:06:51 +0000 |
commit | 44e1d662cb57e2e4e47601350d7e29d1b1a41286 (patch) | |
tree | 353625113161f1420ce87130e3e744cd5dc55270 /winsup/utils/strace.cc | |
parent | fa5f82b2868e4c9825e5bafa48a86ba7b4fbfb19 (diff) | |
download | newlib-44e1d662cb57e2e4e47601350d7e29d1b1a41286.zip newlib-44e1d662cb57e2e4e47601350d7e29d1b1a41286.tar.gz newlib-44e1d662cb57e2e4e47601350d7e29d1b1a41286.tar.bz2 |
* strace.cc (proc_child): Don't right-shift exit value.
(main): Call ExitProcess() to exit exactly the same way as any straced child.
Diffstat (limited to 'winsup/utils/strace.cc')
-rw-r--r-- | winsup/utils/strace.cc | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/winsup/utils/strace.cc b/winsup/utils/strace.cc index 42fb955..f866258 100644 --- a/winsup/utils/strace.cc +++ b/winsup/utils/strace.cc @@ -680,7 +680,7 @@ proc_child (unsigned mask, FILE *ofile, pid_t pid) break; case EXIT_PROCESS_DEBUG_EVENT: - res = ev.u.ExitProcess.dwExitCode >> 8; + res = ev.u.ExitProcess.dwExitCode; remove_child (ev.dwProcessId); break; case EXCEPTION_DEBUG_EVENT: @@ -1076,12 +1076,11 @@ character #%d.\n", optarg, (int) (endptr - optarg), endptr); if (!ofile) ofile = stdout; - DWORD res = 0; if (toggle) dotoggle (pid); else - res = dostrace (mask, ofile, pid, argv + optind); - return res; + ExitProcess (dostrace (mask, ofile, pid, argv + optind)); + return 0; } #undef CloseHandle |