From: Andrew Tridgell Date: Wed, 27 Mar 2002 03:53:22 +0000 (+0100) Subject: made default CCACHE_DIR $HOME/.ccache to avoid some potential /tmp races X-Git-Tag: v1.0~36 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=971801d9b34e598e1377036e1fa606bd5f3ea75f;p=thirdparty%2Fccache.git made default CCACHE_DIR $HOME/.ccache to avoid some potential /tmp races --- diff --git a/README b/README index 5fb296ad1..608f30e92 100644 --- 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 diff --git a/ccache.c b/ccache.c index d5140bcd5..231228100 100644 --- 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"); diff --git a/ccache.h b/ccache.h index 07dc06ef0..a9dbb23c6 100644 --- 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;