diff options
Diffstat (limited to 'src/libstd/rt')
| -rw-r--r-- | src/libstd/rt/io/native/process.rs | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/libstd/rt/io/native/process.rs b/src/libstd/rt/io/native/process.rs index 91fff6d9263..0fa454b94d0 100644 --- a/src/libstd/rt/io/native/process.rs +++ b/src/libstd/rt/io/native/process.rs @@ -649,23 +649,25 @@ fn waitpid(pid: pid_t) -> int { unsafe { - let proc = OpenProcess(SYNCHRONIZE | PROCESS_QUERY_INFORMATION, FALSE, pid as DWORD); - if proc.is_null() { + let process = OpenProcess(SYNCHRONIZE | PROCESS_QUERY_INFORMATION, + FALSE, + pid as DWORD); + if process.is_null() { fail!("failure in OpenProcess: {}", os::last_os_error()); } loop { let mut status = 0; - if GetExitCodeProcess(proc, &mut status) == FALSE { - CloseHandle(proc); + if GetExitCodeProcess(process, &mut status) == FALSE { + CloseHandle(process); fail!("failure in GetExitCodeProcess: {}", os::last_os_error()); } if status != STILL_ACTIVE { - CloseHandle(proc); + CloseHandle(process); return status as int; } - if WaitForSingleObject(proc, INFINITE) == WAIT_FAILED { - CloseHandle(proc); + if WaitForSingleObject(process, INFINITE) == WAIT_FAILED { + CloseHandle(process); fail!("failure in WaitForSingleObject: {}", os::last_os_error()); } } |
