mirror of
https://github.com/debauchee/barrier.git
synced 2024-12-25 03:53:18 +03:00
- fixed: process should shut down when command is empty.
- fixed: when command was empty quotes ("") daemon crashed.
This commit is contained in:
parent
79ab428454
commit
499cd47e63
@ -175,6 +175,7 @@ CMSWindowsRelauncher::mainLoop(void*)
|
||||
// anything yet, so don't show it as a warning, only show it as
|
||||
// debug to devs to let them know why nothing happened.
|
||||
LOG((CLOG_DEBUG "nothing to launch, no command specified."));
|
||||
shutdownExistingProcesses();
|
||||
continue;
|
||||
}
|
||||
|
||||
@ -231,7 +232,7 @@ CMSWindowsRelauncher::isProcessRunning()
|
||||
GetExitCodeProcess(m_processInfo.hProcess, &exitCode);
|
||||
running = (exitCode == STILL_ACTIVE);
|
||||
|
||||
if (!running) {
|
||||
if (!running && !m_command.empty()) {
|
||||
m_failures++;
|
||||
LOG((CLOG_INFO
|
||||
"detected application not running, pid=%d, failures=%d",
|
||||
|
@ -298,6 +298,13 @@ CDaemonApp::handleIpcMessage(const CEvent& e, void*)
|
||||
case kIpcCommand: {
|
||||
CIpcCommandMessage* cm = static_cast<CIpcCommandMessage*>(m);
|
||||
CString command = cm->command();
|
||||
|
||||
// if empty quotes, clear.
|
||||
if (command == "\"\"") {
|
||||
command.clear();
|
||||
}
|
||||
|
||||
if (!command.empty()) {
|
||||
LOG((CLOG_DEBUG "new command, elevate=%d command=%s", cm->elevate(), command.c_str()));
|
||||
|
||||
CString debugArg("--debug");
|
||||
@ -317,6 +324,10 @@ CDaemonApp::handleIpcMessage(const CEvent& e, void*)
|
||||
LOG((CLOG_ERR "failed to save LogLevel setting, %s", e.what().c_str()));
|
||||
}
|
||||
}
|
||||
}
|
||||
else {
|
||||
LOG((CLOG_DEBUG "empty command, elevate=%d", cm->elevate()));
|
||||
}
|
||||
|
||||
try {
|
||||
// store command in system settings. this is used when the daemon
|
||||
|
Loading…
Reference in New Issue
Block a user