summaryrefslogtreecommitdiff
path: root/src/libsystemd
diff options
context:
space:
mode:
authorLennart Poettering <lennart@poettering.net>2014-03-05 03:49:00 +0100
committerLennart Poettering <lennart@poettering.net>2014-03-05 04:08:04 +0100
commitd584f638940366c46a48e34a25cf43e2b77475be (patch)
tree2192d874ce2fa937507312a7502ce2ccee06bcfd /src/libsystemd
parent1ac67edb7c4d31a287fa98c0b554ae98bd34e71b (diff)
core: make the LimitXYZ= properties settable for transient service units
Diffstat (limited to 'src/libsystemd')
-rw-r--r--src/libsystemd/sd-bus/bus-util.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/src/libsystemd/sd-bus/bus-util.c b/src/libsystemd/sd-bus/bus-util.c
index 40aab2a88c..d0ae43da4e 100644
--- a/src/libsystemd/sd-bus/bus-util.c
+++ b/src/libsystemd/sd-bus/bus-util.c
@@ -1372,6 +1372,21 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
r = sd_bus_message_append(m, "v", "a(st)", path, u);
}
+ } else if (rlimit_from_string(field) >= 0) {
+ uint64_t rl;
+
+ if (streq(eq, "infinity"))
+ rl = (uint64_t) -1;
+ else {
+ r = safe_atou64(eq, &rl);
+ if (r < 0) {
+ log_error("Invalid resource limit: %s", eq);
+ return -EINVAL;
+ }
+ }
+
+ r = sd_bus_message_append(m, "v", "t", rl);
+
} else {
log_error("Unknown assignment %s.", assignment);
return -EINVAL;