]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
automount: fix unused value coverity warnings
authorLuca Boccassi <bluca@debian.org>
Fri, 29 Sep 2023 01:00:34 +0000 (02:00 +0100)
committerLuca Boccassi <luca.boccassi@gmail.com>
Fri, 29 Sep 2023 08:17:59 +0000 (09:17 +0100)
'r' is no longer used, so no point in setting it before returning

CID#1522310
CID#1522312

Follow-up for bfeb10911e58bf8890eb7687cf12eddb09ab0c5d

src/core/automount.c

index 8864208288d6f12ccf662c3e7cf2ae20ab2bae47..a34bfae3ac819e1a5804d46c411730aa4b290de7 100644 (file)
@@ -581,13 +581,11 @@ static void automount_enter_waiting(Automount *a) {
         unit_warn_if_dir_nonempty(UNIT(a), a->where);
 
         dev_autofs_fd = open_dev_autofs(UNIT(a)->manager);
-        if (dev_autofs_fd < 0) {
-                r = dev_autofs_fd;
+        if (dev_autofs_fd < 0)
                 goto fail;
-        }
 
         if (pipe2(pipe_fd, O_CLOEXEC) < 0) {
-                r = log_unit_warning_errno(UNIT(a), errno, "Failed to allocate autofs pipe: %m");
+                log_unit_warning_errno(UNIT(a), errno, "Failed to allocate autofs pipe: %m");
                 goto fail;
         }
         r = fd_nonblock(pipe_fd[0], true);
@@ -603,7 +601,7 @@ static void automount_enter_waiting(Automount *a) {
                     getpgrp(),
                     isempty(a->extra_options) ? "" : ",",
                     strempty(a->extra_options)) < 0) {
-                r = log_oom();
+                log_oom();
                 goto fail;
         }
 
@@ -617,13 +615,13 @@ static void automount_enter_waiting(Automount *a) {
         pipe_fd[1] = safe_close(pipe_fd[1]);
 
         if (stat(a->where, &st) < 0) {
-                r = log_unit_warning_errno(UNIT(a), errno, "Failed to stat new automount point '%s': %m", a->where);
+                log_unit_warning_errno(UNIT(a), errno, "Failed to stat new automount point '%s': %m", a->where);
                 goto fail;
         }
 
         ioctl_fd = open_ioctl_fd(dev_autofs_fd, a->where, st.st_dev);
         if (ioctl_fd < 0) {
-                r = log_unit_warning_errno(UNIT(a), ioctl_fd, "Failed to open automount ioctl fd for '%s': %m", a->where);
+                log_unit_warning_errno(UNIT(a), ioctl_fd, "Failed to open automount ioctl fd for '%s': %m", a->where);
                 goto fail;
         }