diff options
author | Vladislav Vaintroub <wlad@mariadb.com> | 2015-12-30 19:39:31 +0100 |
---|---|---|
committer | Vladislav Vaintroub <wlad@mariadb.com> | 2015-12-30 20:59:44 +0100 |
commit | 250ab81200bf62d02c25144e3da38f7a9d3ced19 (patch) | |
tree | 508a3ae8b5efe0d2617e4229c9255b3faa2ca6d9 /mysql-test/lib/My/SafeProcess/safe_process_win.cc | |
parent | f8dd40eec6936aa407b0c89cbee4af2be8d019d2 (diff) | |
download | mariadb-git-250ab81200bf62d02c25144e3da38f7a9d3ced19.tar.gz |
Fix process handle leak in buildbot. GenerateConsoleCtrlEvent sent to non-existing process will add a process handle to this non-existing process to console host process conhost.exe
Diffstat (limited to 'mysql-test/lib/My/SafeProcess/safe_process_win.cc')
-rw-r--r-- | mysql-test/lib/My/SafeProcess/safe_process_win.cc | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/mysql-test/lib/My/SafeProcess/safe_process_win.cc b/mysql-test/lib/My/SafeProcess/safe_process_win.cc index 87a14481e25..dca2faded71 100644 --- a/mysql-test/lib/My/SafeProcess/safe_process_win.cc +++ b/mysql-test/lib/My/SafeProcess/safe_process_win.cc @@ -357,14 +357,14 @@ int main(int argc, const char** argv ) CloseHandle(job_handle); message("Job terminated and closed"); - if (!jobobject_assigned) - { - GenerateConsoleCtrlEvent(CTRL_BREAK_EVENT, process_info.dwProcessId); - TerminateProcess(process_info.hProcess, 202); - } + if (wait_res != WAIT_OBJECT_0 + CHILD) { + if (!jobobject_assigned) + { + TerminateProcess(process_info.hProcess, 202); + } /* The child has not yet returned, wait for it */ message("waiting for child to exit"); if ((wait_res= WaitForSingleObject(wait_handles[CHILD], INFINITE)) |