diff --git a/src/applib/cmdex.cpp b/src/applib/cmdex.cpp index 4774569..25d5798 100644 --- a/src/applib/cmdex.cpp +++ b/src/applib/cmdex.cpp @@ -253,8 +253,13 @@ bool Cmdex::execute() bool Cmdex::try_stop(hz::signal_t sig) { DBG_FUNCTION_ENTER_MSG; +#ifdef _WIN32 + if (!this->running_ || this->pid_ == 0) + return false; +#else if (!this->running_ || this->pid_ <= 0) return false; +#endif // other variants: SIGHUP(1) (terminal closed), SIGINT(2) (Ctrl-C), // SIGKILL(9) (kill).