aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcrupest <crupest@outlook.com>2023-02-06 00:14:55 +0800
committercrupest <crupest@outlook.com>2023-02-06 00:14:55 +0800
commit9322433fa910acace9b6bd1687cabde25f7c14f9 (patch)
tree7e76ac632dd88091cd3a071cb64118f27e32347e
parent7d41d457fe6e7433df030b4e5a3ae59093ad929d (diff)
downloadlife-9322433fa910acace9b6bd1687cabde25f7c14f9.tar.gz
life-9322433fa910acace9b6bd1687cabde25f7c14f9.tar.bz2
life-9322433fa910acace9b6bd1687cabde25f7c14f9.zip
Fix linux run bug.
-rw-r--r--linux-run/linux-run.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/linux-run/linux-run.cpp b/linux-run/linux-run.cpp
index e656e55..dcb9944 100644
--- a/linux-run/linux-run.cpp
+++ b/linux-run/linux-run.cpp
@@ -131,6 +131,7 @@ void run(const std::string &program, std::vector<std::string> arguments,
int poll_return = poll(&sigchld_poll, 1, timeout_value);
if (poll_return == 0) {
+ kill(pid, SIGKILL);
throw TimeoutError("Timeout to run command.");
} else if (poll_return == -1) {
if (errno == EINTR) {