summaryrefslogtreecommitdiff
path: root/src/shared/generator.c
diff options
context:
space:
mode:
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-06-30 18:41:17 -0400
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>2014-06-30 18:41:17 -0400
commit8eea868708923a092ee85d6146ba4c04b7baea06 (patch)
treefcbb03789d329522d5ef87242608fa6467595b62 /src/shared/generator.c
parentb3208b662948b51ff34e7b7752e28ec7a48708ae (diff)
cryptsetup: allow x-systemd.device-timeout
https://bugs.freedesktop.org/show_bug.cgi?id=54210
Diffstat (limited to 'src/shared/generator.c')
-rw-r--r--src/shared/generator.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/shared/generator.c b/src/shared/generator.c
index 1db5f8fb62..5d5b6a0a61 100644
--- a/src/shared/generator.c
+++ b/src/shared/generator.c
@@ -108,7 +108,7 @@ int generator_write_timeouts(const char *dir, const char *what, const char *wher
timeout = start + 25;
else {
if (filtered) {
- *filtered = strdup(opts);
+ *filtered = strdup(opts ?: "");
if (!*filtered)
return log_oom();
}
@@ -146,6 +146,9 @@ int generator_write_timeouts(const char *dir, const char *what, const char *wher
if (!unit)
return -ENOMEM;
- return write_drop_in_format(dir, unit, "device-timeout",
- "[Unit]\nJobTimeoutSec=%u", u / USEC_PER_SEC);
+ return write_drop_in_format(dir, unit, 50, "device-timeout",
+ "# Automatically generated by %s\n\n"
+ "[Unit]\nJobTimeoutSec=%u",
+ program_invocation_short_name,
+ u / USEC_PER_SEC);
}