diff options
Diffstat (limited to 'src/fstab-generator/fstab-generator.c')
-rw-r--r-- | src/fstab-generator/fstab-generator.c | 36 |
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; |