services: use domain target in launchctl list command.

If a service is somehow duplicated across multiple domains, this ensures
that the correct output is produced.
This commit is contained in:
Mike McQuaid 2025-03-25 14:16:29 +00:00
parent 2dbce6bac5
commit 2dcd8846a3
No known key found for this signature in database

View File

@ -234,7 +234,7 @@ module Homebrew
def status_output_success_type
@status_output_success_type ||= if System.launchctl?
cmd = [System.launchctl.to_s, "list", service_name]
cmd = [System.launchctl.to_s, "list", "#{System.domain_target}/#{service_name}"]
output = Utils.popen_read(*cmd).chomp
if $CHILD_STATUS.present? && $CHILD_STATUS.success? && output.present?
success = true