diff options
Diffstat (limited to 'src/cryptsetup')
-rw-r--r-- | src/cryptsetup/cryptsetup-generator.c | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c index 5d234e6a5a..755ee5d88d 100644 --- a/src/cryptsetup/cryptsetup-generator.c +++ b/src/cryptsetup/cryptsetup-generator.c @@ -78,9 +78,9 @@ static int create_disk( if (!e) return log_oom(); - n = unit_name_build("systemd-cryptsetup", e, ".service"); - if (!n) - return log_oom(); + r = unit_name_build("systemd-cryptsetup", e, ".service", &n); + if (r < 0) + return log_error_errno(r, "Failed to generate unit name: %m"); p = strjoin(arg_dest, "/", n, NULL); if (!p) @@ -90,9 +90,9 @@ static int create_disk( if (!u) return log_oom(); - d = unit_name_from_path(u, ".device"); - if (!d) - return log_oom(); + r = unit_name_from_path(u, ".device", &d); + if (r < 0) + return log_error_errno(r, "Failed to generate unit name: %m"); f = fopen(p, "wxe"); if (!f) @@ -128,11 +128,11 @@ static int create_disk( if (!path_equal(uu, "/dev/null")) { if (is_device_path(uu)) { - _cleanup_free_ char *dd; + _cleanup_free_ char *dd = NULL; - dd = unit_name_from_path(uu, ".device"); - if (!dd) - return log_oom(); + r = unit_name_from_path(uu, ".device", &dd); + if (r < 0) + return log_error_errno(r, "Failed to generate unit name: %m"); fprintf(f, "After=%1$s\nRequires=%1$s\n", dd); } else |