diff --git a/src/engine/helper/HL_Process.cpp b/src/engine/helper/HL_Process.cpp index c573746e..363245e8 100644 --- a/src/engine/helper/HL_Process.cpp +++ b/src/engine/helper/HL_Process.cpp @@ -212,6 +212,11 @@ std::string OsProcess::execCommand(const std::string& cmd) return result; } +int OsProcess::execSystem(const std::string& cmd) +{ + return system(cmd.c_str()); +} + #include #include #include @@ -321,7 +326,7 @@ void OsProcess::killByPid(pid_t pid) { if (pid <= 0) return; - execCommand("kill -9 " + std::to_string(pid)); + execSystem("kill " + std::to_string(pid)); } #endif diff --git a/src/engine/helper/HL_Process.h b/src/engine/helper/HL_Process.h index 2f596ae4..e933198d 100644 --- a/src/engine/helper/HL_Process.h +++ b/src/engine/helper/HL_Process.h @@ -10,6 +10,7 @@ class OsProcess { public: static std::string execCommand(const std::string& cmdline); + static int execSystem(const std::string& cmdline); static std::shared_ptr asyncExecCommand(const std::string& cmdline, std::function line_callback, std::function finished_callback,