chiark / gitweb /
missing.h: fix wrong __NR_getrandom syscall def
[elogind.git] / src / cryptsetup / cryptsetup-generator.c
index 137b7876d6636cd177f4fc41cbe5c0171002a8c4..05ceff443fe1dc80529dd6452230e77de472a28d 100644 (file)
@@ -246,7 +246,12 @@ static int create_disk(
         }
 
         if (!noauto && !nofail) {
-                r = write_drop_in(arg_dest, name, 90, "device-timeout",
+                _cleanup_free_ char *dmname;
+                dmname = strjoin("dev-mapper-", e, ".device", NULL);
+                if (!dmname)
+                        return log_oom();
+
+                r = write_drop_in(arg_dest, dmname, 90, "device-timeout",
                                   "# Automatically generated by systemd-cryptsetup-generator \n\n"
                                   "[Unit]\nJobTimeoutSec=0");
                 if (r < 0) {
@@ -387,7 +392,7 @@ int main(int argc, char *argv[]) {
                                 if (k == 2 && streq(proc_uuid, device + 5)) {
                                         free(options);
                                         options = strdup(p);
-                                        if (!proc_options) {
+                                        if (!options) {
                                                 log_oom();
                                                 goto cleanup;
                                         }