]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
shared/bus-unit-util: use common helper in one more place
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 18 Jun 2025 12:31:18 +0000 (14:31 +0200)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Thu, 3 Jul 2025 08:37:33 +0000 (10:37 +0200)
src/shared/bus-unit-util.c

index a0ebf6ba32a774d78e3772d54e820078102a842c..4f82d91536383e62255bc10e3836c19361f2194f 100644 (file)
@@ -717,19 +717,8 @@ static int bus_append_cgroup_property(sd_bus_message *m, const char *field, cons
                 return 1;
         }
 
-        if (streq(field, "CPUQuotaPeriodSec")) {
-                usec_t u = USEC_INFINITY;
-
-                r = parse_sec_def_infinity(eq, &u);
-                if (r < 0)
-                        return log_error_errno(r, "CPU quota period '%s' invalid.", eq);
-
-                r = sd_bus_message_append(m, "(sv)", "CPUQuotaPeriodUSec", "t", u);
-                if (r < 0)
-                        return bus_log_create_error(r);
-
-                return 1;
-        }
+        if (streq(field, "CPUQuotaPeriodSec"))
+                return bus_append_parse_sec_rename(m, field, isempty(eq) ? "infinity" : eq);
 
         if (streq(field, "DeviceAllow")) {
                 if (isempty(eq))