Imported Upstream version 3.1.9 upstream/3.1.9
authorJinWang An <jinwang.an@samsung.com>
Tue, 3 Aug 2021 07:15:28 +0000 (16:15 +0900)
committerJinWang An <jinwang.an@samsung.com>
Tue, 3 Aug 2021 07:15:28 +0000 (16:15 +0900)
14 files changed:
AUTHORS.html
AUTHORS.txt
INSTALL.html
LICENSE.html
MANUAL.html
NEWS.html
NEWS.txt
README.html
ccache.1
ccache.c
execute.c
test.sh
util.c
version.c

index 61673067deb7ba89e3bcba39d8fc0c527589f7a7..1df9412476756b8b55210b2391c4e63f1e24cc96 100644 (file)
@@ -736,7 +736,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache authors</h1>\r
-<span id="revnumber">version 3.1.8</span>\r
+<span id="revnumber">version 3.1.9</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -751,11 +751,21 @@ maintained by Joel Rosdahl.</p></div>
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
+Alfred Landrum &lt;<a href="mailto:alfred.landrum@riverbed.com">alfred.landrum@riverbed.com</a>&gt;\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
 Andrea Bittau &lt;<a href="mailto:a.bittau@cs.ucl.ac.uk">a.bittau@cs.ucl.ac.uk</a>&gt;\r
 </p>\r
 </li>\r
 <li>\r
 <p>\r
+Andrew Stubbs &lt;<a href="mailto:ams@codesourcery.com">ams@codesourcery.com</a>&gt;\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
 Andrew Tridgell &lt;<a href="mailto:tridge@samba.org">tridge@samba.org</a>&gt;\r
 </p>\r
 </li>\r
@@ -892,8 +902,8 @@ Wilson Snyder &lt;<a href="mailto:wsnyder@wsnyder.org">wsnyder@wsnyder.org</a>&g
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.1.8<br />\r
-Last updated 2012-08-11 10:57:17 CEST\r
+Version 3.1.9<br />\r
+Last updated 2013-01-06 17:56:05 CET\r
 </div>\r
 </div>\r
 </body>\r
index 22d0707bfc84a2ea639a7005e2d342c6dcdf5c9a..c09427754565f34298fa50931260c73614dd7331 100644 (file)
@@ -6,7 +6,9 @@ maintained by Joel Rosdahl.
 
 ccache is a collective work with contributions from many people, including:
 
+* Alfred Landrum <alfred.landrum@riverbed.com>
 * Andrea Bittau <a.bittau@cs.ucl.ac.uk>
+* Andrew Stubbs <ams@codesourcery.com>
 * Andrew Tridgell <tridge@samba.org>
 * Bernhard Bauer <bauerb@google.com>
 * Björn Jacke <bj@sernet.de>
index 6d3316eff351ad6f0420643640b4a7e20a8fab97..df37a579d9d2d7d5c79d09e6ac08f6f6bf7f58aa 100644 (file)
@@ -736,7 +736,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache installation</h1>\r
-<span id="revnumber">version 3.1.8</span>\r
+<span id="revnumber">version 3.1.9</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -845,8 +845,8 @@ above.</p></div>
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.1.8<br />\r
-Last updated 2012-01-09 20:53:18 CET\r
+Version 3.1.9<br />\r
+Last updated 2012-11-07 19:42:42 CET\r
 </div>\r
 </div>\r
 </body>\r
index c05d7f3ab2c852f4167861c92f06aaf7f5b802e8..71a33511e9e7f055169cd77fcf6f2157e7d41d5f 100644 (file)
@@ -736,7 +736,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache copyright and license</h1>\r
-<span id="revnumber">version 3.1.8</span>\r
+<span id="revnumber">version 3.1.9</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -1212,8 +1212,8 @@ following license:</p></div>
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.1.8<br />\r
-Last updated 2012-08-11 10:57:17 CEST\r
+Version 3.1.9<br />\r
+Last updated 2013-01-06 17:46:13 CET\r
 </div>\r
 </div>\r
 </body>\r
index 2076988dd0978ff3e31fba22f71a68873e5f0fb6..be2c37ec74c06803f2b3b78a27f1c28a2f7f323a 100644 (file)
@@ -736,7 +736,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>CCACHE(1)</h1>\r
-<span id="revnumber">version 3.1.8</span>\r
+<span id="revnumber">version 3.1.9</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -2002,8 +2002,8 @@ maintained by Joel Rosdahl. See AUTHORS.txt or AUTHORS.html and
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.1.8<br />\r
-Last updated 2012-08-11 10:57:17 CEST\r
+Version 3.1.9<br />\r
+Last updated 2013-01-06 17:46:13 CET\r
 </div>\r
 </div>\r
 </body>\r
index d95929cee6684566df4f90fec71500b7df032e8f..8dc3325a1beed52231f7b8b324db60329c35a785 100644 (file)
--- a/NEWS.html
+++ b/NEWS.html
@@ -736,7 +736,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache news</h1>\r
-<span id="revnumber">version 3.1.8</span>\r
+<span id="revnumber">version 3.1.9</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -744,6 +744,56 @@ asciidoc.install(2);
 </div>\r
 <div id="content">\r
 <div class="sect1">\r
+<h2 id="_ccache_3_1_9">ccache 3.1.9</h2>\r
+<div class="sectionbody">\r
+<div class="paragraph"><p>Release date: 2013-01-06</p></div>\r
+<div class="sect2">\r
+<h3 id="_bug_fixes">Bug fixes</h3>\r
+<div class="ulist"><ul>\r
+<li>\r
+<p>\r
+The EAGAIN signal is now handled correctly when emitting cached stderr\r
+      output. This fixes a problem triggered by large error outputs from the\r
+      compiler.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Subdirectories in the cache are no longer created in read-only mode.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Fixed so that ccache&#8217;s log file descriptor is not made available to the\r
+      compiler.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Improved error reporting when failing to create temporary stdout/stderr\r
+      files when executing the compiler.\r
+</p>\r
+</li>\r
+<li>\r
+<p>\r
+Disappearing temporary stdout/stderr files are now handled gracefully.\r
+</p>\r
+</li>\r
+</ul></div>\r
+</div>\r
+<div class="sect2">\r
+<h3 id="_other">Other</h3>\r
+<div class="ulist"><ul>\r
+<li>\r
+<p>\r
+Fixed test suite to work on ecryptfs.\r
+</p>\r
+</li>\r
+</ul></div>\r
+</div>\r
+</div>\r
+</div>\r
+<div class="sect1">\r
 <h2 id="_ccache_3_1_8">ccache 3.1.8</h2>\r
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2012-08-11</p></div>\r
@@ -769,7 +819,7 @@ Clang plugins are now hashed to catch plugin upgrades.
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes">Bug fixes</h3>\r
+<h3 id="_bug_fixes_2">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -796,7 +846,7 @@ Paths are now correctly canonicalized when computing paths relative to
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_other">Other</h3>\r
+<h3 id="_other_2">Other</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -818,7 +868,7 @@ Fixed <tt>static_assert</tt> macro definition clash with GCC 4.7.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2012-01-08</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_2">Bug fixes</h3>\r
+<h3 id="_bug_fixes_3">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -871,7 +921,7 @@ Reverted the GCC bug compatibility introduced in ccache 3.1.5 for
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_other_2">Other</h3>\r
+<h3 id="_other_3">Other</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -902,7 +952,7 @@ Rewrite argument to <tt>--sysroot</tt> if <tt>CCACHE_BASEDIR</tt> is used.
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_3">Bug fixes</h3>\r
+<h3 id="_bug_fixes_4">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -955,7 +1005,7 @@ Improved order of statistics counters in <tt>ccache -s</tt> output.
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_4">Bug fixes</h3>\r
+<h3 id="_bug_fixes_5">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -989,7 +1039,7 @@ Systems that lack (and don&#8217;t need to be linked with) libm are now
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2011-01-09</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_5">Bug fixes</h3>\r
+<h3 id="_bug_fixes_6">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1022,7 +1072,7 @@ The file handle in now correctly closed on write error when trying to
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2010-11-28</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_6">Bug fixes</h3>\r
+<h3 id="_bug_fixes_7">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1033,7 +1083,7 @@ The -MFarg, -MTarg and -MQarg compiler options (i.e, without space
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_other_3">Other</h3>\r
+<h3 id="_other_4">Other</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1049,7 +1099,7 @@ Portability fixes for HP-UX 11.00 and other esoteric systems.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2010-11-21</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_7">Bug fixes</h3>\r
+<h3 id="_bug_fixes_8">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1070,7 +1120,7 @@ Fixed issue when parsing precompiler output on AIX.
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_other_4">Other</h3>\r
+<h3 id="_other_5">Other</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1097,7 +1147,7 @@ The test suite now also works on systems that lack a /dev/zero.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2010-11-07</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_8">Bug fixes</h3>\r
+<h3 id="_bug_fixes_9">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1136,7 +1186,7 @@ ccache development version (set by dev.mk) now works with gits whose
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_other_5">Other</h3>\r
+<h3 id="_other_6">Other</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1221,7 +1271,7 @@ Added <tt>-install_name</tt> as an option known to take an argument. (This
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_9">Bug fixes</h3>\r
+<h3 id="_bug_fixes_10">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1247,7 +1297,7 @@ EINTR is now handled correctly.
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_other_6">Other</h3>\r
+<h3 id="_other_7">Other</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1309,7 +1359,7 @@ New <tt>HACKING.txt</tt> file with some notes about ccache code conventions.
 <div class="sectionbody">\r
 <div class="paragraph"><p>Release date: 2010-07-15</p></div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_10">Bug fixes</h3>\r
+<h3 id="_bug_fixes_11">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1503,7 +1553,7 @@ The following options are no longer hashed in the preprocessor mode:
 </ul></div>\r
 </div>\r
 <div class="sect2">\r
-<h3 id="_bug_fixes_11">Bug fixes</h3>\r
+<h3 id="_bug_fixes_12">Bug fixes</h3>\r
 <div class="ulist"><ul>\r
 <li>\r
 <p>\r
@@ -1648,8 +1698,8 @@ Statistics counters are now correctly updated for -E option failures and
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.1.8<br />\r
-Last updated 2012-08-11 10:57:17 CEST\r
+Version 3.1.9<br />\r
+Last updated 2013-01-06 17:55:15 CET\r
 </div>\r
 </div>\r
 </body>\r
index 1ffa0a29c51a1ac88ec464326c7ca9a6fd992f44..554c6ff298920d9a83fce5b0e6b6c429257f75fb 100644 (file)
--- a/NEWS.txt
+++ b/NEWS.txt
@@ -2,6 +2,31 @@ ccache news
 ===========
 
 
+ccache 3.1.9
+------------
+Release date: 2013-01-06
+
+
+Bug fixes
+~~~~~~~~~
+
+    - The EAGAIN signal is now handled correctly when emitting cached stderr
+      output. This fixes a problem triggered by large error outputs from the
+      compiler.
+    - Subdirectories in the cache are no longer created in read-only mode.
+    - Fixed so that ccache's log file descriptor is not made available to the
+      compiler.
+    - Improved error reporting when failing to create temporary stdout/stderr
+      files when executing the compiler.
+    - Disappearing temporary stdout/stderr files are now handled gracefully.
+
+
+Other
+~~~~~
+
+    - Fixed test suite to work on ecryptfs.
+
+
 ccache 3.1.8
 ------------
 Release date: 2012-08-11
index 486d8511d6d9796b2ae24acea1c6021382cd0620..f58e224f1c0c6b2f142630cd72e3837a465b8cf5 100644 (file)
@@ -736,7 +736,7 @@ asciidoc.install(2);
 <body class="article">\r
 <div id="header">\r
 <h1>ccache README</h1>\r
-<span id="revnumber">version 3.1.8</span>\r
+<span id="revnumber">version 3.1.9</span>\r
 <div id="toc">
   <div id="toctitle">Table of Contents</div>
   <noscript><p><b>JavaScript must be enabled in your browser to display the table of contents.</b></p></noscript>
@@ -832,8 +832,8 @@ Thiele&#8217;s &#8220;compilercache&#8221; (see <a href="http://www.erikyyy.de/c
 <div id="footnotes"><hr /></div>\r
 <div id="footer">\r
 <div id="footer-text">\r
-Version 3.1.8<br />\r
-Last updated 2012-01-09 20:53:18 CET\r
+Version 3.1.9<br />\r
+Last updated 2012-11-07 19:42:42 CET\r
 </div>\r
 </div>\r
 </body>\r
index c2c106a1d72f5d67236600bb7107af9ab34f670a..2ba09f8a2ea03b9c42036164c12902711036a5ff 100644 (file)
--- a/ccache.1
+++ b/ccache.1
@@ -2,12 +2,12 @@
 .\"     Title: ccache
 .\"    Author: [see the "Author" section]
 .\" Generator: DocBook XSL Stylesheets v1.76.1 <http://docbook.sf.net/>
-.\"      Date: 08/11/2012
+.\"      Date: 01/06/2013
 .\"    Manual: ccache Manual
-.\"    Source: ccache 3.1.8
+.\"    Source: ccache 3.1.9
 .\"  Language: English
 .\"
-.TH "CCACHE" "1" "08/11/2012" "ccache 3\&.1\&.8" "ccache Manual"
+.TH "CCACHE" "1" "01/06/2013" "ccache 3\&.1\&.9" "ccache Manual"
 .\" -----------------------------------------------------------------
 .\" * Define some portability stuff
 .\" -----------------------------------------------------------------
index 738c022f3638acdb838d0904f61dc91d45e92bc1..02dbdfab89150bdf2d4f349b815cdcd7b8fe642d 100644 (file)
--- a/ccache.c
+++ b/ccache.c
@@ -2,7 +2,7 @@
  * ccache -- a fast C/C++ compiler cache
  *
  * Copyright (C) 2002-2007 Andrew Tridgell
- * Copyright (C) 2009-2012 Joel Rosdahl
+ * Copyright (C) 2009-2013 Joel Rosdahl
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
@@ -266,7 +266,7 @@ get_path_in_cache(const char *name, const char *suffix)
                char *p = format("%s/%c", path, name[i]);
                free(path);
                path = p;
-               if (create_dir(path) != 0) {
+               if (!getenv("CCACHE_READONLY") && create_dir(path) != 0) {
                        fatal("Failed to create %s: %s", path, strerror(errno));
                }
        }
@@ -551,7 +551,13 @@ to_cache(struct args *args)
        args_pop(args, 3);
 
        if (stat(tmp_stdout, &st) != 0) {
-               fatal("Could not create %s (permission denied?)", tmp_stdout);
+               /* The stdout file was removed - cleanup in progress? Better bail out. */
+               cc_log("%s not found: %s", tmp_stdout, strerror(errno));
+               stats_update(STATS_MISSING);
+               tmp_unlink(tmp_stdout);
+               tmp_unlink(tmp_stderr);
+               tmp_unlink(tmp_obj);
+               failed();
        }
        if (st.st_size != 0) {
                cc_log("Compiler produced stdout");
index f1970d375758122703ae7582800cdc9ffa0a402b..761aa80b34baebe4ccc2f5ce55a8ca3511b8d7fe 100644 (file)
--- a/execute.c
+++ b/execute.c
 
 #include "ccache.h"
 
+/* Let's hope no compiler uses these exit statuses. */
+#define FAILED_TO_CREATE_STDOUT 212
+#define FAILED_TO_CREATE_STDERR 213
+
 static char *
 find_executable_in_path(const char *name, const char *exclude_name, char *path);
 
@@ -179,7 +183,8 @@ execute(char **argv, const char *path_stdout, const char *path_stderr)
                tmp_unlink(path_stdout);
                fd = open(path_stdout, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_BINARY, 0666);
                if (fd == -1) {
-                       exit(1);
+                       cc_log("Error creating %s: %s", path_stdout, strerror(errno));
+                       exit(FAILED_TO_CREATE_STDOUT);
                }
                dup2(fd, 1);
                close(fd);
@@ -187,7 +192,8 @@ execute(char **argv, const char *path_stdout, const char *path_stderr)
                tmp_unlink(path_stderr);
                fd = open(path_stderr, O_WRONLY|O_CREAT|O_TRUNC|O_EXCL|O_BINARY, 0666);
                if (fd == -1) {
-                       exit(1);
+                       cc_log("Error creating %s: %s", path_stderr, strerror(errno));
+                       exit(FAILED_TO_CREATE_STDERR);
                }
                dup2(fd, 2);
                close(fd);
@@ -203,6 +209,12 @@ execute(char **argv, const char *path_stdout, const char *path_stderr)
                return -1;
        }
 
+       if (status == FAILED_TO_CREATE_STDOUT) {
+               fatal("Could not create %s (permission denied?)", path_stdout);
+       } else if (status == FAILED_TO_CREATE_STDERR) {
+               fatal("Could not create %s (permission denied?)", path_stderr);
+       }
+
        return WEXITSTATUS(status);
 }
 #endif
diff --git a/test.sh b/test.sh
index 372c1889c50cb1c33636ceec37af0aee43b41a98..3ed90697bf6ec0eb1a69e4affbb1cfe65a8d74cb 100755 (executable)
--- a/test.sh
+++ b/test.sh
@@ -497,7 +497,7 @@ base_suite() {
 
 link_suite() {
     if [ `dirname $COMPILER` = . ]; then
-        ln -s ../ccache $COMPILER
+        ln -s "$CCACHE" $COMPILER
         CCACHE_COMPILE="./$COMPILER"
         base_tests
     else
@@ -1387,17 +1387,26 @@ readonly_suite() {
     # Make the cache readonly
     # Check that readonly mode finds the result.
     testname="cache hit"
-    rm -f test.o
+    rm -f test.o test2.o
     chmod -R a-w $CCACHE_DIR
-    CCACHE_READONLY=1 CCACHE_TEMPDIR=/tmp CCACHE_PREFIX=false $CCACHE $COMPILER -c test.c -o test.o
-    status=$?
+    CCACHE_READONLY=1 CCACHE_TEMPDIR=/tmp CCACHE_PREFIX=false $CCACHE $COMPILER -c test.c -o test.o >/dev/null 2>&1
+    status1=$?
+    # Check that fallback to the real compiler works for a cache miss.
+    CCACHE_READONLY=1 CCACHE_TEMPDIR=/tmp $CCACHE $COMPILER -c test2.c -o test2.o >/dev/null 2>&1
+    status2=$?
     chmod -R a+w $CCACHE_DIR
-    if [ $status -ne 0 ]; then
+    if [ $status1 -ne 0 ]; then
         test_failed "failure when compiling test.c readonly"
     fi
+    if [ $status2 -ne 0 ]; then
+        test_failed "failure when compiling test2.c readonly"
+    fi
     if [ ! -f test.o ]; then
         test_failed "test.o missing"
     fi
+    if [ ! -f test2.o ]; then
+        test_failed "test2.o missing"
+    fi
 
     # Check that readonly mode doesn't try to store new results.
     testname="cache miss"
@@ -1542,6 +1551,11 @@ cleanup_suite() {
         fi
     done
 
+    # Warning: this test is known to fail on filesystems that have
+    # unusual block sizes, including ecryptfs.  The workaround is
+    # to place the test directory elsewhere:
+    #     cd /tmp
+    #     CCACHE=$DIR/ccache $DIR/test.sh
     testname="forced cleanup, size limit"
     $CCACHE -C >/dev/null
     prepare_cleanup_test $CCACHE_DIR/a
diff --git a/util.c b/util.c
index b4898000642b6df777f8502d89846daa5a80c225..3b472def20976e81f688593ebd66586eb6962d02 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1,6 +1,6 @@
 /*
  * Copyright (C) 2002 Andrew Tridgell
- * Copyright (C) 2009-2012 Joel Rosdahl
+ * Copyright (C) 2009-2013 Joel Rosdahl
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the Free
@@ -48,6 +48,11 @@ init_log(void)
        }
        logfile = fopen(cache_logfile, "a");
        if (logfile) {
+               int fd = fileno(logfile);
+               int flags = fcntl(fd, F_GETFD, 0);
+               if (flags >= 0) {
+                       fcntl(fd, F_SETFD, flags | FD_CLOEXEC);
+               }
                return true;
        } else {
                return false;
@@ -149,10 +154,13 @@ copy_fd(int fd_in, int fd_out)
                ssize_t count, written = 0;
                do {
                        count = write(fd_out, buf + written, n - written);
-                       if (count == -1 && errno != EINTR) {
-                               fatal("Failed to copy fd");
+                       if (count == -1) {
+                               if (errno != EAGAIN && errno != EINTR) {
+                                       fatal("Failed to copy fd");
+                               }
+                       } else {
+                               written += count;
                        }
-                       written += count;
                } while (written < n);
        }
 
@@ -1118,7 +1126,7 @@ x_unlink(const char *path)
         * file. We don't care if the temp file is trashed, so it's always safe to
         * unlink it first.
         */
-       char* tmp_name = format("%s.%s.rmXXXXXX", path, tmp_string());
+       char *tmp_name = format("%s.tmp.rm.%s", path, tmp_string());
        int result = 0;
        cc_log("Unlink %s via %s", path, tmp_name);
        if (x_rename(path, tmp_name) == -1) {
index d845ba94713e7aa9221fddf1e2de6f15b9edce85..e6943841a83aa4314354042f6d62fadabad9f297 100644 (file)
--- a/version.c
+++ b/version.c
@@ -1 +1 @@
-const char CCACHE_VERSION[] = "3.1.8";
+const char CCACHE_VERSION[] = "3.1.9";