chiark / gitweb /
cryptsetup: allow x-systemd.device-timeout
[elogind.git] / src / shared / generator.c
index 1db5f8f..5d5b6a0 100644 (file)
@@ -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);
 }