]> git.ipfire.org Git - thirdparty/ccache.git/commitdiff
Check CCACHE_DEBUG_HASH environment variable before enabling hash debugging
authorJoel Rosdahl <joel@rosdahl.net>
Tue, 8 Jun 2010 20:47:53 +0000 (22:47 +0200)
committerJoel Rosdahl <joel@rosdahl.net>
Tue, 8 Jun 2010 20:47:53 +0000 (22:47 +0200)
mdfour.c

index 78fca282d1083876be9523361b61283631710271..311c0cf59b012c25800695374b4bd18600ef5a53 100644 (file)
--- a/mdfour.c
+++ b/mdfour.c
@@ -18,6 +18,7 @@
 
 #include "ccache.h"
 
+#include <stdlib.h>
 #include <string.h>
 
 /* NOTE: This code makes no attempt to be fast! */
@@ -140,9 +141,11 @@ void mdfour_update(struct mdfour *md, const unsigned char *in, size_t n)
        uint32_t M[16];
 
 #ifdef CCACHE_DEBUG_HASH
-       FILE* f = fopen("ccache-debug-hash.bin", "a");
-       fwrite(in, 1, n, f);
-       fclose(f);
+       if (getenv("CCACHE_DEBUG_HASH")) {
+               FILE* f = fopen("ccache-debug-hash.bin", "a");
+               fwrite(in, 1, n, f);
+               fclose(f);
+       }
 #endif
 
        m = md;