From: Joel Rosdahl Date: Tue, 8 Jun 2010 20:47:53 +0000 (+0200) Subject: Check CCACHE_DEBUG_HASH environment variable before enabling hash debugging X-Git-Tag: v3.0~45 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=93c6e9ac32677f0891b71799497649fa7e1cc17e;p=thirdparty%2Fccache.git Check CCACHE_DEBUG_HASH environment variable before enabling hash debugging --- diff --git a/mdfour.c b/mdfour.c index 78fca282d..311c0cf59 100644 --- a/mdfour.c +++ b/mdfour.c @@ -18,6 +18,7 @@ #include "ccache.h" +#include #include /* 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;