Mapping from "FooBar" to "foo-bar" is unnecessary and makes it hard to
handle many different properties with the same code, hence, let's just
not do it.
dbus_message_iter_get_basic(i, &b);
c->cpu_accounting = b;
dbus_message_iter_get_basic(i, &b);
c->cpu_accounting = b;
- unit_write_drop_in_private_section(u, mode, "cpu-accounting", b ? "CPUAccounting=yes" : "CPUAccounting=no");
+ unit_write_drop_in_private_section(u, mode, name, b ? "CPUAccounting=yes" : "CPUAccounting=no");
c->cpu_shares = ul;
sprintf(buf, "CPUShares=%lu", ul);
c->cpu_shares = ul;
sprintf(buf, "CPUShares=%lu", ul);
- unit_write_drop_in_private_section(u, mode, "cpu-shares", buf);
+ unit_write_drop_in_private_section(u, mode, name, buf);
dbus_message_iter_get_basic(i, &b);
c->blockio_accounting = b;
dbus_message_iter_get_basic(i, &b);
c->blockio_accounting = b;
- unit_write_drop_in_private_section(u, mode, "block-io-accounting", b ? "BlockIOAccounting=yes" : "BlockIOAccounting=no");
+ unit_write_drop_in_private_section(u, mode, name, b ? "BlockIOAccounting=yes" : "BlockIOAccounting=no");
c->cpu_shares = ul;
sprintf(buf, "BlockIOWeight=%lu", ul);
c->cpu_shares = ul;
sprintf(buf, "BlockIOWeight=%lu", ul);
- unit_write_drop_in_private_section(u, mode, "blockio-weight", buf);
+ unit_write_drop_in_private_section(u, mode, name, buf);
dbus_message_iter_get_basic(i, &b);
c->memory_accounting = b;
dbus_message_iter_get_basic(i, &b);
c->memory_accounting = b;
- unit_write_drop_in_private_section(u, mode, "memory-accounting", b ? "MemoryAccounting=yes" : "MemoryAccounting=no");
+ unit_write_drop_in_private_section(u, mode, name, b ? "MemoryAccounting=yes" : "MemoryAccounting=no");
if (streq(name, "MemoryLimit")) {
c->memory_limit = limit;
sprintf(buf, "MemoryLimit=%" PRIu64, limit);
if (streq(name, "MemoryLimit")) {
c->memory_limit = limit;
sprintf(buf, "MemoryLimit=%" PRIu64, limit);
- unit_write_drop_in_private_section(u, mode, "memory-limit", buf);
+ unit_write_drop_in_private_section(u, mode, name, buf);
} else {
c->memory_soft_limit = limit;
sprintf(buf, "MemorySoftLimit=%" PRIu64, limit);
} else {
c->memory_soft_limit = limit;
sprintf(buf, "MemorySoftLimit=%" PRIu64, limit);
- unit_write_drop_in_private_section(u, mode, "memory-soft-limit", buf);
+ unit_write_drop_in_private_section(u, mode, name, buf);
c->device_policy = p;
buf = strappenda("DevicePolicy=", policy);
c->device_policy = p;
buf = strappenda("DevicePolicy=", policy);
- unit_write_drop_in_private_section(u, mode, "device-policy", buf);
+ unit_write_drop_in_private_section(u, mode, name, buf);
fprintf(f, "DeviceAllow=%s %s%s%s\n", a->path, a->r ? "r" : "", a->w ? "w" : "", a->m ? "m" : "");
fflush(f);
fprintf(f, "DeviceAllow=%s %s%s%s\n", a->path, a->r ? "r" : "", a->w ? "w" : "", a->m ? "m" : "");
fflush(f);
- unit_write_drop_in_private_section(u, mode, "device-allow", buf);
+ unit_write_drop_in_private_section(u, mode, name, buf);
- unit_write_drop_in_private_section(UNIT(s), mode, "exec-start", buf);
+ unit_write_drop_in_private_section(UNIT(s), mode, name, buf);
if (!contents)
return -ENOMEM;
if (!contents)
return -ENOMEM;
- unit_write_drop_in(u, mode, "Description", contents);
+ unit_write_drop_in(u, mode, name, contents);
if (!contents)
return -ENOMEM;
if (!contents)
return -ENOMEM;
- unit_write_drop_in(u, mode, "Slice", contents);
+ unit_write_drop_in(u, mode, name, contents);