summaryrefslogtreecommitdiff
path: root/src/shared/generator.c
diff options
context:
space:
mode:
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);
}