Merge pull request #31886 from DaanDeMeyer/logind

logind: Add fallback for when the PIDFDs= property is not available
This commit is contained in:
Mike Yuan
2024-03-24 19:19:12 +08:00
committed by GitHub
9 changed files with 43 additions and 32 deletions
+2 -2
View File
@@ -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);
+1 -1
View File
@@ -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);