]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
doveadm sis: Fix "Uninitialized argument value" scan-build complaint
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Fri, 14 Oct 2022 07:53:24 +0000 (10:53 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Tue, 18 Oct 2022 10:05:50 +0000 (10:05 +0000)
The code was a bit ugly in that it didn't set error_r on ENOENT. There was
no bug because the caller did check for this, but scan-build didn't
understand it.

src/doveadm/doveadm-sis.c

index 2b1f24edb32c409f968e18e70df37b0dc7c96afa..9900a3e191693e1a58a5b1bda43f8011f551576d 100644 (file)
@@ -41,14 +41,12 @@ file_contents_equal(const char *path1, const char *path2, ino_t *path2_inode_r,
           the same or if this is a hash collision */
        fd1 = open(path1, O_RDONLY);
        if (fd1 == -1) {
-               if (errno != ENOENT)
-                       *error_r = t_strdup_printf("open(%s) failed: %m", path1);
+               *error_r = t_strdup_printf("open(%s) failed: %m", path1);
                return -1;
        }
        fd2 = open(path2, O_RDONLY);
        if (fd2 == -1) {
-               if (errno != ENOENT)
-                       *error_r = t_strdup_printf("open(%s) failed: %m", path2);
+               *error_r = t_strdup_printf("open(%s) failed: %m", path2);
                i_close_fd(&fd1);
                return -1;
        }