summaryrefslogtreecommitdiff
path: root/src/cryptsetup
diff options
context:
space:
mode:
authorMichal Schmidt <mschmidt@redhat.com>2014-11-28 19:57:32 +0100
committerMichal Schmidt <mschmidt@redhat.com>2014-11-28 19:57:32 +0100
commit4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4f (patch)
treec7a6228e7151aa74bc8e331694a1e795226550cd /src/cryptsetup
parent56f64d95763a799ba4475daf44d8e9f72a1bd474 (diff)
treewide: another round of simplifications
Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications".
Diffstat (limited to 'src/cryptsetup')
-rw-r--r--src/cryptsetup/cryptsetup-generator.c30
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;