Re: [ccache] PATCH: Print temp file name in debug message

2010-09-17 Thread Joel Rosdahl
On 2010-09-17 21:56, Wilson Snyder wrote:
> First, congrats on finishing the latest release.  It's so wonderful to
> have great progress.

Thanks.

> Anyhow, here's a trivial patch I'd like considered.  I had
> to resolve a conflict around it in git when I updated so
> might as well feed it up, as it may help others debug too!

Sure, why not. Applied!

-- Joel
___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


[ccache] PATCH: Print temp file name in debug message

2010-09-17 Thread Wilson Snyder

First, congrats on finishing the latest release.  It's so wonderful to
have great progress.

Anyhow, here's a trivial patch I'd like considered.  I had
to resolve a conflict around it in git when I updated so
might as well feed it up, as it may help others debug too!

diff --git a/util.c b/util.c
index 4917328..c485efc 100644
--- a/util.c
+++ b/util.c
@@ -187,8 +187,9 @@ copy_file(const char *src, const char *dest, int 
compress_dest)
   struct stat st;
   int errnum;
 
-   cc_log("Copying %s to %s (%s)",
-  src, dest, compress_dest ? "compressed": "uncompressed");
+   x_asprintf(&tmp_name, "%s.%s.XX", dest, tmp_string());
+   cc_log("Copying %s to %s via %s (%s)",
+  src, dest, tmp_name, compress_dest ? "compressed": 
"uncompressed");
 
/* open source file */
fd_in = open(src, O_RDONLY | O_BINARY);
@@ -205,7 +206,6 @@ copy_file(const char *src, const char *dest, int 
compress_dest)
   }
 
/* open destination file */
-   tmp_name = format("%s.%s.XX", dest, tmp_string());
fd_out = mkstemp(tmp_name);
if (fd_out == -1) {
   cc_log("mkstemp error: %s", strerror(errno));

___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache


[ccache] PATCH: Print temp file name in debug message

2010-09-17 Thread Wilson Snyder

>First, congrats on finishing the latest release.  It's so wonderful to
>have great progress.
>
>Anyhow, here's a trivial patch I'd like considered.  I had
>to resolve a conflict around it in git when I updated so
>might as well feed it up, as it may help others debug too!

Sorry sent the old version, need to use format with the new code!

diff --git a/util.c b/util.c
index 4917328..c485efc 100644
--- a/util.c
+++ b/util.c
@@ -187,8 +187,9 @@ copy_file(const char *src, const char *dest, int 
compress_dest)
   struct stat st;
   int errnum;
 
-   cc_log("Copying %s to %s (%s)",
-  src, dest, compress_dest ? "compressed": "uncompressed");
+   tmp_name = format("%s.%s.XX", dest, tmp_string());
+   cc_log("Copying %s to %s via %s (%s)",
+  src, dest, tmp_name, compress_dest ? "compressed": 
"uncompressed");
 
/* open source file */
fd_in = open(src, O_RDONLY | O_BINARY);
@@ -205,7 +206,6 @@ copy_file(const char *src, const char *dest, int 
compress_dest)
   }
 
/* open destination file */
-   tmp_name = format("%s.%s.XX", dest, tmp_string());
fd_out = mkstemp(tmp_name);
if (fd_out == -1) {
   cc_log("mkstemp error: %s", strerror(errno));

___
ccache mailing list
ccache@lists.samba.org
https://lists.samba.org/mailman/listinfo/ccache