From: Joel Rosdahl Date: Fri, 4 Jun 2010 16:26:55 +0000 (+0200) Subject: Avoid logging "open error" when trying to copy output from failing compiler X-Git-Tag: v3.0~56 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=0b97d2c74b8bd92233a265f534fe0ad844ce4485;p=thirdparty%2Fccache.git Avoid logging "open error" when trying to copy output from failing compiler --- diff --git a/ccache.c b/ccache.c index 0acf649f8..b7c4b1aaa 100644 --- 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 */