treewide: another round of simplifications

Using the same scripts as in f647962d64 "treewide: yet more log_*_errno
+ return simplifications".
This commit is contained in:
Michal Schmidt
2014-11-28 19:57:32 +01:00
parent 56f64d9576
commit 4a62c710b6
65 changed files with 433 additions and 854 deletions
+10 -20
View File
@@ -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;