tree-wide: prefer sending pifds over pids when creating scope units
This commit is contained in:
@@ -2817,6 +2817,22 @@ 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) {
|
||||
assert(m);
|
||||
|
||||
if (!pidref_is_set(pidref))
|
||||
return -ESRCH;
|
||||
|
||||
if (pidref->fd >= 0)
|
||||
return sd_bus_message_append(
|
||||
m, "(sv)",
|
||||
"PIDFDs", "ah", 1, pidref->fd);
|
||||
|
||||
return sd_bus_message_append(
|
||||
m, "(sv)",
|
||||
"PIDs", "au", 1, pidref->pid);
|
||||
}
|
||||
|
||||
int bus_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet) {
|
||||
const char *type, *path, *source;
|
||||
InstallChange *changes = NULL;
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "sd-bus.h"
|
||||
|
||||
#include "install.h"
|
||||
#include "pidref.h"
|
||||
#include "unit-def.h"
|
||||
|
||||
typedef struct UnitInfo {
|
||||
@@ -25,6 +26,8 @@ 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_deserialize_and_dump_unit_file_changes(sd_bus_message *m, bool quiet);
|
||||
|
||||
int unit_load_state(sd_bus *bus, const char *name, char **load_state);
|
||||
|
||||
Reference in New Issue
Block a user