From 971801d9b34e598e1377036e1fa606bd5f3ea75f Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Wed, 27 Mar 2002 04:53:22 +0100 Subject: [PATCH] made default CCACHE_DIR $HOME/.ccache to avoid some potential /tmp races --- README | 2 +- ccache.c | 4 +++- ccache.h | 2 -- 3 files changed, 4 insertions(+), 4 deletions(-) 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; -- 2.47.3