From 0b7d39288e87555ded736acfeb15376da09b3b6c Mon Sep 17 00:00:00 2001 From: Timo Sirainen Date: Thu, 21 Oct 2010 19:03:39 +0100 Subject: [PATCH] Static analyzer warning fix. --- src/doveadm/doveadm-sis.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/doveadm/doveadm-sis.c b/src/doveadm/doveadm-sis.c index f2b4402b3a..92201630e6 100644 --- a/src/doveadm/doveadm-sis.c +++ b/src/doveadm/doveadm-sis.c @@ -34,6 +34,8 @@ file_contents_equal(const char *path1, const char *path2, ino_t *path2_inode_r) struct stat st1, st2; int fd1, fd2, ret = -1; + *path2_inode_r = 0; + /* do a byte-by-byte comparison for the files to find out if they're the same or if this is a hash collision */ fd1 = open(path1, O_RDONLY); @@ -79,6 +81,7 @@ file_contents_equal(const char *path1, const char *path2, ino_t *path2_inode_r) i_error("read(%s) failed: %m", path1); else if (ret1 == 0) ret = 1; + *path2_inode_r = st2.st_ino; } if (close(fd1) < 0) @@ -86,7 +89,6 @@ file_contents_equal(const char *path1, const char *path2, ino_t *path2_inode_r) if (close(fd2) < 0) i_error("close(%s) failed: %m", path2); - *path2_inode_r = st2.st_ino; return ret; } -- 2.47.3