From: Joel Rosdahl Date: Sun, 3 Jan 2016 19:45:15 +0000 (+0100) Subject: Don't (try to) update manifest in readonly modes X-Git-Tag: v3.2.5~15 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a7ab503f07e31ebeaaec34fbaa30e264308a299d;p=thirdparty%2Fccache.git Don't (try to) update manifest in readonly modes --- diff --git a/NEWS.txt b/NEWS.txt index f3151d89d..4f4b7aa68 100644 --- a/NEWS.txt +++ b/NEWS.txt @@ -23,6 +23,9 @@ Bug fixes - Fixed failure to create directories on QNX. +- Don't (try to) update manifest file in ``read-only and ``read-only direct'' + modes. + ccache 3.2.4 ------------ diff --git a/ccache.c b/ccache.c index ee03e6e85..58e60a0c4 100644 --- a/ccache.c +++ b/ccache.c @@ -801,6 +801,9 @@ put_file_in_cache(const char *source, const char *dest) struct stat st; bool do_link = conf->hard_link && !conf->compression; + assert(!conf->read_only); + assert(!conf->read_only_direct); + if (do_link) { x_unlink(dest); ret = link(source, dest); @@ -1809,7 +1812,8 @@ from_cache(enum fromcache_call_mode mode, bool put_object_in_manifest) update_mtime(cached_dwo); } - if (generating_dependencies && mode == FROMCACHE_CPP_MODE) { + if (generating_dependencies && mode == FROMCACHE_CPP_MODE + && !conf->read_only && !conf->read_only_direct) { put_file_in_cache(output_dep, cached_dep); }