]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-fs: fs_copy*() didn't update metadata_changed correctly.
authorTimo Sirainen <tss@iki.fi>
Sun, 16 Aug 2015 11:14:11 +0000 (13:14 +0200)
committerTimo Sirainen <tss@iki.fi>
Sun, 16 Aug 2015 11:14:11 +0000 (13:14 +0200)
It was supposed to be (only) set when the copying actually finished.

src/lib-fs/fs-api.c

index 00f9d783a1fca72164d47dba862df3a109d8dacb..632cb2c1845d4d4c260091029768391181ba575f 100644 (file)
@@ -761,7 +761,7 @@ int fs_copy(struct fs_file *src, struct fs_file *dest)
        T_BEGIN {
                ret = src->fs->v.copy(src, dest);
        } T_END;
-       if (ret < 0 || errno != EAGAIN)
+       if (!(ret < 0 && errno == EAGAIN))
                dest->metadata_changed = FALSE;
        return ret;
 }
@@ -773,7 +773,7 @@ int fs_copy_finish_async(struct fs_file *dest)
        T_BEGIN {
                ret = dest->fs->v.copy(NULL, dest);
        } T_END;
-       if (ret < 0 || errno != EAGAIN)
+       if (!(ret < 0 && errno == EAGAIN))
                dest->metadata_changed = FALSE;
        return ret;
 }