summaryrefslogtreecommitdiff
path: root/src/fstab-generator/fstab-generator.c
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/fstab-generator/fstab-generator.c
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/fstab-generator/fstab-generator.c')
-rw-r--r--src/fstab-generator/fstab-generator.c36
1 files changed, 12 insertions, 24 deletions
diff --git a/src/fstab-generator/fstab-generator.c b/src/fstab-generator/fstab-generator.c
index 1c85a729b8..e8a21f7fff 100644
--- a/src/fstab-generator/fstab-generator.c
+++ b/src/fstab-generator/fstab-generator.c
@@ -148,10 +148,8 @@ static int add_swap(
return log_oom();
mkdir_parents_label(lnk, 0755);
- if (symlink(unit, lnk) < 0) {
- log_error_errno(errno, "Failed to create symlink %s: %m", lnk);
- return -errno;
- }
+ if (symlink(unit, lnk) < 0)
+ return log_error_errno(errno, "Failed to create symlink %s: %m", lnk);
}
return 0;
@@ -268,10 +266,8 @@ static int add_mount(
fprintf(f, "Options=%s\n", filtered);
fflush(f);
- if (ferror(f)) {
- log_error_errno(errno, "Failed to write unit file %s: %m", unit);
- return -errno;
- }
+ if (ferror(f))
+ return log_error_errno(errno, "Failed to write unit file %s: %m", unit);
if (!noauto && post) {
lnk = strjoin(arg_dest, "/", post, nofail || automount ? ".wants/" : ".requires/", name, NULL);
@@ -279,10 +275,8 @@ static int add_mount(
return log_oom();
mkdir_parents_label(lnk, 0755);
- if (symlink(unit, lnk) < 0) {
- log_error_errno(errno, "Failed to create symlink %s: %m", lnk);
- return -errno;
- }
+ if (symlink(unit, lnk) < 0)
+ return log_error_errno(errno, "Failed to create symlink %s: %m", lnk);
}
if (automount) {
@@ -296,10 +290,8 @@ static int add_mount(
fclose(f);
f = fopen(automount_unit, "wxe");
- if (!f) {
- log_error_errno(errno, "Failed to create unit file %s: %m", automount_unit);
- return -errno;
- }
+ if (!f)
+ return log_error_errno(errno, "Failed to create unit file %s: %m", automount_unit);
fprintf(f,
"# Automatically generated by systemd-fstab-generator\n\n"
@@ -319,10 +311,8 @@ static int add_mount(
where);
fflush(f);
- if (ferror(f)) {
- log_error_errno(errno, "Failed to write unit file %s: %m", automount_unit);
- return -errno;
- }
+ if (ferror(f))
+ return log_error_errno(errno, "Failed to write unit file %s: %m", automount_unit);
free(lnk);
lnk = strjoin(arg_dest, "/", post, nofail ? ".wants/" : ".requires/", automount_name, NULL);
@@ -330,10 +320,8 @@ static int add_mount(
return log_oom();
mkdir_parents_label(lnk, 0755);
- if (symlink(automount_unit, lnk) < 0) {
- log_error_errno(errno, "Failed to create symlink %s: %m", lnk);
- return -errno;
- }
+ if (symlink(automount_unit, lnk) < 0)
+ return log_error_errno(errno, "Failed to create symlink %s: %m", lnk);
}
return 0;