From: Joel Rosdahl Date: Mon, 21 Oct 2019 18:06:22 +0000 (+0200) Subject: Don’t fail fatally if temporary cpp_stderr file is missing X-Git-Tag: v4.0~727 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=9c12bd692f8a57b8bd7d4eed386abc8cfba39540;p=thirdparty%2Fccache.git Don’t fail fatally if temporary cpp_stderr file is missing If the temporary cpp_stderr file is missing when the compilation command has finished then either some user removed it or ccache removed it in clean_up_internal_tempdir (since the compilation took more than hour or the system clock was adjusted?). In either case, let’s just fall back to running the real compiler instead of failing fatally. Fixes #480 and #154. (cherry picked from commit c74dbfe5d43fc23733bd44839b9bd119da94ba26) --- diff --git a/src/ccache.cpp b/src/ccache.cpp index a4549719e..51be84429 100644 --- a/src/ccache.cpp +++ b/src/ccache.cpp @@ -1598,7 +1598,10 @@ get_result_name_from_cpp(struct args* args, struct hash* hash) hash_delimiter(hash, "cppstderr"); if (!direct_i_file && !hash_file(hash, path_stderr)) { - fatal("Failed to open %s: %s", path_stderr, strerror(errno)); + // Somebody removed the temporary file? + stats_update(STATS_ERROR); + cc_log("Failed to open %s: %s", path_stderr, strerror(errno)); + failed(); } if (direct_i_file) {