From: Joel Rosdahl Date: Sat, 5 Jan 2013 17:10:36 +0000 (+0100) Subject: Handle disappearing temporary stdout file gracefully X-Git-Tag: v3.1.9~1 X-Git-Url: http://git.ipfire.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=17791e1e460aec9c0efc1edbd031e975b81c1855;p=thirdparty%2Fccache.git Handle disappearing temporary stdout file gracefully If the temporary stdout file has disappeared, it's most likely because another ccache process is doing cleanup on a too small cache. --- diff --git a/ccache.c b/ccache.c index 50137d398..02dbdfab8 100644 --- a/ccache.c +++ b/ccache.c @@ -2,7 +2,7 @@ * ccache -- a fast C/C++ compiler cache * * Copyright (C) 2002-2007 Andrew Tridgell - * Copyright (C) 2009-2012 Joel Rosdahl + * Copyright (C) 2009-2013 Joel Rosdahl * * This program is free software; you can redistribute it and/or modify it * under the terms of the GNU General Public License as published by the Free @@ -551,7 +551,13 @@ to_cache(struct args *args) args_pop(args, 3); if (stat(tmp_stdout, &st) != 0) { - fatal("Could not create %s (permission denied?)", tmp_stdout); + /* The stdout file was removed - cleanup in progress? Better bail out. */ + cc_log("%s not found: %s", tmp_stdout, strerror(errno)); + stats_update(STATS_MISSING); + tmp_unlink(tmp_stdout); + tmp_unlink(tmp_stderr); + tmp_unlink(tmp_obj); + failed(); } if (st.st_size != 0) { cc_log("Compiler produced stdout");