mirror of
https://github.com/systemd/systemd.git
synced 2024-11-06 16:59:03 +03:00
dbus-scope: simplify bus_scope_set_transient_property()
This commit is contained in:
parent
886295990b
commit
0fb0fffa09
@ -26,6 +26,7 @@
|
||||
#include "dbus-kill.h"
|
||||
#include "dbus-scope.h"
|
||||
#include "dbus-unit.h"
|
||||
#include "dbus-util.h"
|
||||
#include "dbus.h"
|
||||
#include "scope.h"
|
||||
#include "selinux-access.h"
|
||||
@ -84,6 +85,9 @@ static int bus_scope_set_transient_property(
|
||||
|
||||
flags |= UNIT_PRIVATE;
|
||||
|
||||
if (streq(name, "TimeoutStopUSec"))
|
||||
return bus_set_transient_usec(UNIT(s), name, &s->timeout_stop_usec, message, flags, error);
|
||||
|
||||
if (streq(name, "PIDs")) {
|
||||
unsigned n = 0;
|
||||
uint32_t pid;
|
||||
@ -138,21 +142,6 @@ static int bus_scope_set_transient_property(
|
||||
return r;
|
||||
}
|
||||
|
||||
return 1;
|
||||
|
||||
} else if (streq(name, "TimeoutStopUSec")) {
|
||||
uint64_t t;
|
||||
|
||||
r = sd_bus_message_read(message, "t", &t);
|
||||
if (r < 0)
|
||||
return r;
|
||||
|
||||
if (!UNIT_WRITE_FLAGS_NOOP(flags)) {
|
||||
s->timeout_stop_usec = t;
|
||||
|
||||
unit_write_settingf(UNIT(s), flags, name, "TimeoutStopSec=" USEC_FMT "us", t);
|
||||
}
|
||||
|
||||
return 1;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user