chiark / gitweb /
treewide: another round of simplifications
[elogind.git] / src / fstab-generator / fstab-generator.c
index 1c85a729b82093392dbf85608b704de24a558488..e8a21f7fff75078fb2d848deb30172493fc50c59 100644 (file)
@@ -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;