From: Andrew Tridgell Date: Thu, 28 Mar 2002 21:38:41 +0000 (+0100) Subject: fixed a copy_file() race condition X-Git-Tag: v1.0~11 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e27b51a85a41d243c2708bcbb8de737f2a0783fb;p=thirdparty%2Fccache.git fixed a copy_file() race condition --- diff --git a/ccache.c b/ccache.c index fa632e464..40e66c2df 100644 --- a/ccache.c +++ b/ccache.c @@ -275,9 +275,9 @@ static void from_cache(int first) } free(stderr_file); - if (ret == -1 && errno != ENOENT) { + if (ret == -1) { ret = copy_file(hashname, output_file); - if (ret == -1 && errno != ENOENT) { + if (ret == -1) { cc_log("failed to copy %s -> %s (%s)\n", hashname, output_file, strerror(errno)); failed();