From 4a62c710b62a5a3c7a8a278b810b9d5b5a0c8f4f Mon Sep 17 00:00:00 2001 From: Michal Schmidt Date: Fri, 28 Nov 2014 19:57:32 +0100 Subject: treewide: another round of simplifications Using the same scripts as in f647962d64e "treewide: yet more log_*_errno + return simplifications". --- src/fstab-generator/fstab-generator.c | 36 ++++++++++++----------------------- 1 file changed, 12 insertions(+), 24 deletions(-) (limited to 'src/fstab-generator') 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; -- cgit v1.2.3-54-g00ecf