diff options
Diffstat (limited to 'src/cryptsetup')
-rw-r--r-- | src/cryptsetup/cryptsetup-generator.c | 30 |
1 files changed, 10 insertions, 20 deletions
diff --git a/src/cryptsetup/cryptsetup-generator.c b/src/cryptsetup/cryptsetup-generator.c index b27223cd6c..45c23bb323 100644 --- a/src/cryptsetup/cryptsetup-generator.c +++ b/src/cryptsetup/cryptsetup-generator.c @@ -116,10 +116,8 @@ static int create_disk( return log_oom(); f = fopen(p, "wxe"); - if (!f) { - log_error_errno(errno, "Failed to create unit file %s: %m", p); - return -errno; - } + if (!f) + return log_error_errno(errno, "Failed to create unit file %s: %m", p); fputs( "# Automatically generated by systemd-cryptsetup-generator\n\n" @@ -200,10 +198,8 @@ static int create_disk( name); fflush(f); - if (ferror(f)) { - log_error_errno(errno, "Failed to write file %s: %m", p); - return -errno; - } + if (ferror(f)) + return log_error_errno(errno, "Failed to write file %s: %m", p); from = strappenda("../", n); @@ -214,10 +210,8 @@ static int create_disk( return log_oom(); mkdir_parents_label(to, 0755); - if (symlink(from, to) < 0) { - log_error_errno(errno, "Failed to create symlink %s: %m", to); - return -errno; - } + if (symlink(from, to) < 0) + return log_error_errno(errno, "Failed to create symlink %s: %m", to); free(to); if (!nofail) @@ -228,10 +222,8 @@ static int create_disk( return log_oom(); mkdir_parents_label(to, 0755); - if (symlink(from, to) < 0) { - log_error_errno(errno, "Failed to create symlink %s: %m", to); - return -errno; - } + if (symlink(from, to) < 0) + return log_error_errno(errno, "Failed to create symlink %s: %m", to); } free(to); @@ -240,10 +232,8 @@ static int create_disk( return log_oom(); mkdir_parents_label(to, 0755); - if (symlink(from, to) < 0) { - log_error_errno(errno, "Failed to create symlink %s: %m", to); - return -errno; - } + if (symlink(from, to) < 0) + return log_error_errno(errno, "Failed to create symlink %s: %m", to); if (!noauto && !nofail) { _cleanup_free_ char *dmname; |