]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Make failure to create files in cache fatal
authorJoel Rosdahl <joel@rosdahl.net>
Mon, 19 Dec 2011 19:59:53 +0000 (20:59 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 19 Dec 2011 19:59:53 +0000 (20:59 +0100)
Previously, such failures were erroneously flagged as "compiler produced
stdout".

ccache.c

index 9f6d003c496e425129c419720ad1b87db054e216..e35916885408ab8608c892f0cca22516947d81ed 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -529,7 +529,10 @@ to_cache(struct args *args)
        status = execute(args->argv, tmp_stdout, tmp_stderr);
        args_pop(args, 3);
 
-       if (stat(tmp_stdout, &st) != 0 || st.st_size != 0) {
+       if (stat(tmp_stdout, &st) != 0) {
+               fatal("Could not create %s (permission denied?)", tmp_stdout);
+       }
+       if (st.st_size != 0) {
                cc_log("Compiler produced stdout");
                stats_update(STATS_STDOUT);
                tmp_unlink(tmp_stdout);