]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Minor doc string fixes
authorJoel Rosdahl <joel@rosdahl.net>
Sat, 9 Oct 2010 14:39:35 +0000 (16:39 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Mon, 1 Nov 2010 17:31:35 +0000 (18:31 +0100)
util.c

diff --git a/util.c b/util.c
index 5091a8fd3ef0b769f2b18471956eb33cf2dd6610..a0ffb45a910fb015eaee76d42ecfa879c7d1c86f 100644 (file)
--- a/util.c
+++ b/util.c
@@ -1054,32 +1054,33 @@ x_rename(const char *oldpath, const char *newpath)
 }
 
 /*
- * Remove path, NFS hazardous, for temporary files that will not exist
- * on other systems only.  IE the "path" should include tmp_string().
+ * Remove path, NFS hazardous. Use only for temporary files that will not exist
+ * on other systems. That is, the path should include tmp_string().
  */
 int
 tmp_unlink(const char *path)
 {
        cc_log("Unlink %s (as-tmp)", path);
-       return (unlink(path));
+       return unlink(path);
 }
 
 /*
- * Remove path, safely for NFS
+ * Remove path, NFS safe.
  */
 int
 x_unlink(const char *path)
 {
-       /* If path is on an NFS share, unlink isn't atomic, so we rename to a temp file */
-       /* We don't care if tempfile is trashed, so it's always safe to unlink it first */
+       /*
+        * If path is on an NFS share, unlink isn't atomic, so we rename to a temp
+        * file. We don't care if the temp file is trashed, so it's always safe to
+        * unlink it first.
+        */
        const char* tmp_name = format("%s.%s.rmXXXXXX", path, tmp_string());
        cc_log("Unlink %s via %s", path, tmp_name);
        if (x_rename(path, tmp_name) == -1) {
-               /* let caller report the error, or not */
                return -1;
        }
        if (unlink(tmp_name) == -1) {
-               /* let caller report the error, or not */
                return -1;
        }
        return 0;