]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
added CCACHE_HASHDIR option
authorAndrew Tridgell <tridge@samba.org>
Tue, 7 Jan 2003 05:19:00 +0000 (06:19 +0100)
committerAndrew Tridgell <tridge@samba.org>
Tue, 7 Jan 2003 05:19:00 +0000 (06:19 +0100)
ccache.c

index aa47203751e2cd1fc1407e58319173762520219f..f55f74d0f16f69444d8fc3146e7bc399468abc21 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -284,6 +284,15 @@ static void find_hash(ARGS *args)
        hash_int(st.st_size);
        hash_int(st.st_mtime);
 
+       /* possibly hash the current working directory */
+       if (getenv("CCACHE_HASHDIR")) {
+               char *cwd = gnu_getcwd();
+               if (cwd) {
+                       hash_string(cwd);
+                       free(cwd);
+               }
+       }
+
        /* now the run */
        x_asprintf(&path_stdout, "%s/tmp.stdout.%s.%s", cache_dir, tmp_string(), 
                   i_extension);