]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Fix problem with basedir in cwd with symlink
authorJoel Rosdahl <joel@rosdahl.net>
Thu, 17 Oct 2013 19:26:00 +0000 (21:26 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Thu, 17 Oct 2013 19:26:00 +0000 (21:26 +0200)
Root cause pointed out by ishikawa@yk.rim.or.jp.

ccache.c
test.sh

index ea9b39ba3711623367a818d4501f48741345c796..90c38e748e3f31e310e249d93c69d38c61085b30 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -2464,8 +2464,6 @@ initialize(void)
        if (conf->umask != UINT_MAX) {
                umask(conf->umask);
        }
-
-       current_working_dir = get_cwd();
 }
 
 /* Reset the global state. Used by the test suite. */
diff --git a/test.sh b/test.sh
index 5e042b4dbe278f12ed21d54a95808ad67b610f51..b8d1165805b6e9fdc5f4826f20f6cf11f45313c0 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -1429,7 +1429,8 @@ EOF
     $CCACHE -z >/dev/null
     $CCACHE -C >/dev/null
 
-    cd dir1
+    ln -s dir1 symlink_to_dir1
+    cd symlink_to_dir1
     CCACHE_BASEDIR="`pwd`" $CCACHE $COMPILER -I`pwd`/include -c src/test.c
     checkstat 'cache hit (direct)' 0
     checkstat 'cache hit (preprocessed)' 0