]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
made default CCACHE_DIR $HOME/.ccache to avoid some potential /tmp races
authorAndrew Tridgell <tridge@samba.org>
Wed, 27 Mar 2002 03:53:22 +0000 (04:53 +0100)
committerAndrew Tridgell <tridge@samba.org>
Wed, 27 Mar 2002 03:53:22 +0000 (04:53 +0100)
README
ccache.c
ccache.h

diff --git a/README b/README
index 5fb296ad16c6861cc1c412cd1eb0d70b13da60af..608f30e92857da1a3e9c24500cba2d812c3f8aa7 100644 (file)
--- a/README
+++ b/README
@@ -39,7 +39,7 @@ will be fine.
    CCACHE_DIR
 
    the CCACHE_DIR environment variable specifies where ccache will
-   keep its cached compiler output. The default is "/tmp/ccache". 
+   keep its cached compiler output. The default is "$HOME/.ccache". 
 
 
    CCACHE_LOGFILE
index d5140bcd5878a85b9b2d371859c04460c8479919..231228100f2d27ec33fe6830684311d7c3eb5e2a 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -473,7 +473,9 @@ static void ccache(int argc, char *argv[])
 int main(int argc, char *argv[])
 {
        cache_dir = getenv("CCACHE_DIR");
-       if (!cache_dir) cache_dir = CACHE_DIR_DEFAULT;
+       if (!cache_dir) {
+               x_asprintf(&cache_dir, "%s/.ccache", getenv("HOME"));
+       }
 
        cache_logfile = getenv("CCACHE_LOGFILE");
 
index 07dc06ef07d21207f85b8360524c873236e5393b..a9dbb23c6f98c1e8fa48a18a6a95209a38f59021 100644 (file)
--- a/ccache.h
+++ b/ccache.h
@@ -18,8 +18,6 @@
 #define STATUS_FATAL 4
 #define STATUS_NOCACHE 5
 
-#define CACHE_DIR_DEFAULT "/tmp/ccache"
-
 #define MAX_LINE_SIZE 102400
 
 typedef unsigned uint32;