Skip to content

Commit

Permalink
Update for pqrs::osx::launchctl::find_pid updates
Browse files Browse the repository at this point in the history
  • Loading branch information
tekezo committed Jul 21, 2024
1 parent 854382d commit 0189472
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 8 deletions.
2 changes: 0 additions & 2 deletions src/apps/ServiceManager-Non-Privileged-Agents/src/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,6 @@ RunLoop.main.perform {

case .running:
var exitCode: Int32 = 0
libkrbn_initialize()
for n in coreAgentServiceNames {
// A non-resident agent that runs only once
if n == "org.pqrs.service.agent.karabiner_grabber" {
Expand All @@ -112,7 +111,6 @@ RunLoop.main.perform {
}
}
}
libkrbn_terminate()
exit(exitCode)

default:
Expand Down
2 changes: 0 additions & 2 deletions src/apps/ServiceManager-Privileged-Daemons/src/main.swift
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ RunLoop.main.perform {

case .running:
var exitCode: Int32 = 0
libkrbn_initialize()
for n in coreDaemonServiceNames {
n.withCString {
if !libkrbn_services_daemon_running($0) {
Expand All @@ -61,7 +60,6 @@ RunLoop.main.perform {
}
}
}
libkrbn_terminate()
exit(exitCode)

default:
Expand Down
6 changes: 2 additions & 4 deletions src/share/services_utility.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -142,15 +142,13 @@ inline bool core_agents_enabled(void) {
}

inline bool daemon_running(const std::string& service_name) {
auto pid = pqrs::osx::launchctl::find_pid(pqrs::dispatcher::extra::get_shared_dispatcher(),
pqrs::osx::launchctl::make_system_domain_target(),
auto pid = pqrs::osx::launchctl::find_pid(pqrs::osx::launchctl::make_system_domain_target(),
pqrs::osx::launchctl::service_name(service_name));
return pid != std::nullopt;
}

inline bool agent_running(const std::string& service_name) {
auto pid = pqrs::osx::launchctl::find_pid(pqrs::dispatcher::extra::get_shared_dispatcher(),
pqrs::osx::launchctl::make_gui_domain_target(),
auto pid = pqrs::osx::launchctl::find_pid(pqrs::osx::launchctl::make_gui_domain_target(),
pqrs::osx::launchctl::service_name(service_name));
return pid != std::nullopt;
}
Expand Down

0 comments on commit 0189472

Please sign in to comment.