From b8cf34c691623e4ec329053cbbf68522a855882d Mon Sep 17 00:00:00 2001 From: DongHun Kwak Date: Thu, 5 Dec 2019 15:12:59 +0900 Subject: Imported Upstream version 1.67.0 --- boost/process/detail/windows/terminate.hpp | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) (limited to 'boost/process/detail/windows/terminate.hpp') diff --git a/boost/process/detail/windows/terminate.hpp b/boost/process/detail/windows/terminate.hpp index ba66e4085c..8a413173da 100644 --- a/boost/process/detail/windows/terminate.hpp +++ b/boost/process/detail/windows/terminate.hpp @@ -20,15 +20,6 @@ namespace boost { namespace process { namespace detail { namespace windows { struct child_handle; -inline void terminate(child_handle &p) -{ - if (!::boost::winapi::TerminateProcess(p.process_handle(), EXIT_FAILURE)) - boost::process::detail::throw_last_error("TerminateProcess() failed"); - - ::boost::winapi::CloseHandle(p.proc_info.hProcess); - p.proc_info.hProcess = ::boost::winapi::INVALID_HANDLE_VALUE_; -} - inline void terminate(child_handle &p, std::error_code &ec) noexcept { if (!::boost::winapi::TerminateProcess(p.process_handle(), EXIT_FAILURE)) @@ -41,8 +32,12 @@ inline void terminate(child_handle &p, std::error_code &ec) noexcept } } - - +inline void terminate(child_handle &p) +{ + std::error_code ec; + terminate(p, ec); + boost::process::detail::throw_error(ec, "TerminateProcess() failed in terminate"); +} }}}} -- cgit v1.2.3