summaryrefslogtreecommitdiff
path: root/boost/process/detail/windows/terminate.hpp
diff options
context:
space:
mode:
authorDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:12:59 +0900
committerDongHun Kwak <dh0128.kwak@samsung.com>2019-12-05 15:12:59 +0900
commitb8cf34c691623e4ec329053cbbf68522a855882d (patch)
tree34da08632a99677f6b79ecb65e5b655a5b69a67f /boost/process/detail/windows/terminate.hpp
parent3fdc3e5ee96dca5b11d1694975a65200787eab86 (diff)
downloadboost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.gz
boost-b8cf34c691623e4ec329053cbbf68522a855882d.tar.bz2
boost-b8cf34c691623e4ec329053cbbf68522a855882d.zip
Imported Upstream version 1.67.0upstream/1.67.0
Diffstat (limited to 'boost/process/detail/windows/terminate.hpp')
-rw-r--r--boost/process/detail/windows/terminate.hpp17
1 files changed, 6 insertions, 11 deletions
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");
+}
}}}}