]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
cope better with missing hash files
authorAndrew Tridgell <tridge@samba.org>
Thu, 28 Mar 2002 05:48:39 +0000 (06:48 +0100)
committerAndrew Tridgell <tridge@samba.org>
Thu, 28 Mar 2002 05:48:39 +0000 (06:48 +0100)
ccache.c

index 8946da8e33f8e5b1706a59bc344584733fea1718..60fec413c62fe917d154d1657d87164ffedc9fc3 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -262,10 +262,19 @@ static void from_cache(int first)
                return;
        }
        utime(stderr_file, NULL);
-       free(stderr_file);
 
        unlink(output_file);
        ret = link(hashname, output_file);
+
+       /* the hash file might have been deleted by some external process */
+       if (ret == -1 && errno == ENOENT) {
+               cc_log("hashfile missing for %s\n", output_file);
+               close(fd_stderr);
+               unlink(stderr_file);
+               return;
+       }
+       free(stderr_file);
+
        if (ret == -1 && errno != ENOENT) {
                ret = copy_file(hashname, output_file);
                if (ret == -1 && errno != ENOENT) {