]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Avoid logging "open error" when trying to copy output from failing compiler
authorJoel Rosdahl <joel@rosdahl.net>
Fri, 4 Jun 2010 16:26:55 +0000 (18:26 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Fri, 4 Jun 2010 16:26:55 +0000 (18:26 +0200)
ccache.c

index 0acf649f80445888ed5d63b7255db1854957dfb0..b7c4b1aaada5e4bc7d76aa58c12a1907428cbfa8 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -660,7 +660,8 @@ static void to_cache(ARGS *args)
                fd = open(tmp_stderr, O_RDONLY | O_BINARY);
                if (fd != -1) {
                        if (strcmp(output_obj, "/dev/null") == 0
-                           || move_file(tmp_obj, output_obj, 0) == 0
+                           || (access(tmp_obj, R_OK) == 0
+                               && move_file(tmp_obj, output_obj, 0) == 0)
                            || errno == ENOENT) {
                                /* we can use a quick method of
                                   getting the failed output */