From: Timo Sirainen Date: Fri, 14 Oct 2022 07:53:24 +0000 (+0300) Subject: doveadm sis: Fix "Uninitialized argument value" scan-build complaint X-Git-Tag: 2.4.0~3548 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c523910c0e5e35cfefb1a8520e2367249add40d2;p=thirdparty%2Fdovecot%2Fcore.git doveadm sis: Fix "Uninitialized argument value" scan-build complaint 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. --- diff --git a/src/doveadm/doveadm-sis.c b/src/doveadm/doveadm-sis.c index 2b1f24edb3..9900a3e191 100644 --- a/src/doveadm/doveadm-sis.c +++ b/src/doveadm/doveadm-sis.c @@ -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; }