Merge pull request #31886 from DaanDeMeyer/logind
logind: Add fallback for when the PIDFDs= property is not available
This commit is contained in:
@@ -2821,13 +2821,13 @@ int bus_append_unit_property_assignment_many(sd_bus_message *m, UnitType t, char
|
||||
return 0;
|
||||
}
|
||||
|
||||
int bus_append_scope_pidref(sd_bus_message *m, const PidRef *pidref) {
|
||||
int bus_append_scope_pidref(sd_bus_message *m, const PidRef *pidref, bool allow_pidfd) {
|
||||
assert(m);
|
||||
|
||||
if (!pidref_is_set(pidref))
|
||||
return -ESRCH;
|
||||
|
||||
if (pidref->fd >= 0)
|
||||
if (pidref->fd >= 0 && allow_pidfd)
|
||||
return sd_bus_message_append(
|
||||
m, "(sv)",
|
||||
"PIDFDs", "ah", 1, pidref->fd);
|
||||
|
||||
@@ -26,7 +26,7 @@ int bus_parse_unit_info(sd_bus_message *message, UnitInfo *u);
|
||||
int bus_append_unit_property_assignment(sd_bus_message *m, UnitType t, const char *assignment);
|
||||
int bus_append_unit_property_assignment_many(sd_bus_message *m, UnitType t, char **l);
|
||||
|
||||
int bus_append_scope_pidref(sd_bus_message *m, const PidRef *pidref);
|
||||
int bus_append_scope_pidref(sd_bus_message *m, const PidRef *pidref, bool allow_pidfd);
|
||||
|
||||
int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user