]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Fix check of destination fd in copy_file
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 10 Jun 2019 20:53:42 +0000 (22:53 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 10 Jun 2019 20:53:42 +0000 (22:53 +0200)
src/util.c

index 07cf48ae689061142e5f9b2c809997e91ad79ea4..b55b84ba2778d480d3224d8294f351f143882265 100644 (file)
@@ -347,8 +347,8 @@ copy_file(const char *src, const char *dest)
        }
 
        int dest_fd = open(dest, O_WRONLY | O_CREAT | O_BINARY, 0666);
-       if (src_fd == -1) {
-               close(src_fd);
+       if (dest_fd == -1) {
+               close(dest_fd);
                return false;
        }