]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Don't (try to) update manifest in readonly modes
authorJoel Rosdahl <joel@rosdahl.net>
Sun, 3 Jan 2016 19:45:15 +0000 (20:45 +0100)
committerJoel Rosdahl <joel@rosdahl.net>
Sun, 3 Jan 2016 19:48:58 +0000 (20:48 +0100)
NEWS.txt
ccache.c

index f3151d89deca5f676471ec102bc2b44915334523..4f4b7aa68edbbb4a109cfbc6604edb04815cd04c 100644 (file)
--- 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
 ------------
index ee03e6e852665bccce33f1300c3131badfbb1668..58e60a0c4ae8ab669502fbeca224fc83d857e66d 100644 (file)
--- 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);
        }