]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
Merge pull request #1569 from mustrumr/date-parse-additions
authorLennart Poettering <lennart@poettering.net>
Thu, 15 Oct 2015 11:09:26 +0000 (13:09 +0200)
committerLennart Poettering <lennart@poettering.net>
Thu, 15 Oct 2015 11:09:26 +0000 (13:09 +0200)
Date parse additions

shell-completion/bash/systemd-run
src/core/dbus-execute.c
src/shared/bus-util.c

index 462ee33959963d426cbe88274115951f6337b9ff..518812e040958860a20c112c108365fbc14cbecc 100644 (file)
@@ -84,7 +84,7 @@ _systemd_run() {
                          LimitNICE= LimitRTPRIO= LimitRTTIME= PrivateTmp= PrivateDevices=
                          PrivateNetwork= NoNewPrivileges= WorkingDirectory= RootDirectory=
                          TTYPath= SyslogIdentifier= SyslogLevelPrefix= SyslogLevel=
-                         SyslogFacility='
+                         SyslogFacility= TimerSlackNSec='
 
             COMPREPLY=( $(compgen -W '$comps' -- "$cur") )
             return 0
index 8b1f830476dd98ba58044ffa3f74435f27da42c7..436229330e54d795e55092fdc0b1ea64efca2b9b 100644 (file)
@@ -1171,6 +1171,21 @@ int bus_exec_context_set_transient_property(
 
                 return 1;
 
+        } else if (streq(name, "TimerSlackNSec")) {
+
+                nsec_t n;
+
+                r = sd_bus_message_read(message, "t", &n);
+                if (r < 0)
+                        return r;
+
+                if (mode != UNIT_CHECK) {
+                        c->timer_slack_nsec = n;
+                        unit_write_drop_in_private_format(u, mode, name, "TimerSlackNSec=" NSEC_FMT "\n", n);
+                }
+
+                return 1;
+
         } else if (rlimit_from_string(name) >= 0) {
                 uint64_t rl;
                 rlim_t x;
index 3a45ac4064262e1b776af04523c7dfa12081fa57..a5d6edbba94a38c502297c8a3f25a79f90f0a4d1 100644 (file)
@@ -1655,7 +1655,16 @@ int bus_append_unit_property_assignment(sd_bus_message *m, const char *assignmen
                 }
 
                 r = sd_bus_message_append(m, "v", "t", u);
+        } else if (streq(field, "TimerSlackNSec")) {
+                nsec_t n;
 
+                r = parse_nsec(eq, &n);
+                if (r < 0) {
+                        log_error("Failed to parse %s value %s", field, eq);
+                        return -EINVAL;
+                }
+
+                r = sd_bus_message_append(m, "v", "t", n);
         } else {
                 log_error("Unknown assignment %s.", assignment);
                 return -EINVAL;