mirror of
https://github.com/Retropex/bitcoin.git
synced 2025-05-12 19:20:42 +02:00
Revert "remove unused method Popen::kill
from cpp-subprocess"
This reverts commit 97f159776e
.
This commit is contained in:
parent
c4e37efad2
commit
fffb6838ed
@ -920,6 +920,7 @@ private:
|
||||
* wait() - Wait for the child to exit.
|
||||
* retcode() - The return code of the exited child.
|
||||
* poll() - Check the status of the running child.
|
||||
* kill(sig_num) - Kill the child. SIGTERM used by default.
|
||||
* send(...) - Send input to the input channel of the child.
|
||||
* communicate(...) - Get the output/error from the child and close the channels
|
||||
* from the parent side.
|
||||
@ -972,6 +973,10 @@ public:
|
||||
|
||||
int poll() noexcept(false);
|
||||
|
||||
// Does not fail, Caller is expected to recheck the
|
||||
// status with a call to poll()
|
||||
void kill(int sig_num = 9);
|
||||
|
||||
void set_out_buf_cap(size_t cap) { stream_.set_out_buf_cap(cap); }
|
||||
|
||||
void set_err_buf_cap(size_t cap) { stream_.set_err_buf_cap(cap); }
|
||||
@ -1132,6 +1137,18 @@ inline int Popen::poll() noexcept(false)
|
||||
#endif
|
||||
}
|
||||
|
||||
inline void Popen::kill(int sig_num)
|
||||
{
|
||||
#ifdef __USING_WINDOWS__
|
||||
if (!TerminateProcess(this->process_handle_, (UINT)sig_num)) {
|
||||
throw OSError("TerminateProcess", 0);
|
||||
}
|
||||
#else
|
||||
::kill(child_pid_, sig_num);
|
||||
#endif
|
||||
}
|
||||
|
||||
|
||||
inline void Popen::execute_process() noexcept(false)
|
||||
{
|
||||
#ifdef __USING_WINDOWS__
|
||||
|
Loading…
Reference in New Issue
Block a user