Commit b8885286 authored by Mike Hibler's avatar Mike Hibler

Resync with master branch.

parent 01a5fc2e
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
#include "imagehash.h" #include "imagehash.h"
#include "queue.h" #include "queue.h"
//#define TERSE_DUMP_OUTPUT #define TERSE_DUMP_OUTPUT
#define HANDLE_SPLIT_HASH #define HANDLE_SPLIT_HASH
#ifndef linux #ifndef linux
...@@ -88,6 +88,7 @@ static int sanity = 0; ...@@ -88,6 +88,7 @@ static int sanity = 0;
#ifdef HANDLE_SPLIT_HASH #ifdef HANDLE_SPLIT_HASH
static int splithash = 0; static int splithash = 0;
#endif #endif
static int quiet = 0;
static char chunkbuf[CHUNKSIZE]; static char chunkbuf[CHUNKSIZE];
...@@ -130,7 +131,7 @@ main(int argc, char **argv) ...@@ -130,7 +131,7 @@ main(int argc, char **argv)
extern char build_info[]; extern char build_info[];
struct hashinfo *hashinfo = 0; struct hashinfo *hashinfo = 0;
while ((ch = getopt(argc, argv, "cCb:dvhno:rD:NVRF:SX")) != -1) while ((ch = getopt(argc, argv, "cCb:dvhno:rD:NVRF:SXq")) != -1)
switch(ch) { switch(ch) {
case 'b': case 'b':
hashblksize = atol(optarg); hashblksize = atol(optarg);
...@@ -199,6 +200,9 @@ main(int argc, char **argv) ...@@ -199,6 +200,9 @@ main(int argc, char **argv)
fprintf(stderr, "-X not supported, ignored\n"); fprintf(stderr, "-X not supported, ignored\n");
#endif #endif
break; break;
case 'q':
quiet = 1;
break;
case 'h': case 'h':
case '?': case '?':
default: default:
...@@ -855,14 +859,13 @@ checkhash(char *name, struct hashinfo *hinfo) ...@@ -855,14 +859,13 @@ checkhash(char *name, struct hashinfo *hinfo)
stopreader(); stopreader();
if (!quiet)
dump_stats(0);
if (badhashes)
printf("%s: %u regions (%d chunks) had bad hashes, "
"%llu bytes affected\n",
name, badhashes, badchunks,
(unsigned long long)badhashdata);
if (!quiet) { if (!quiet) {
dump_stats(0);
if (badhashes)
printf("%s: %u regions (%d chunks) had bad hashes, "
"%llu bytes affected\n",
name, badhashes, badchunks,
(unsigned long long)badhashdata);
dump_readbufs(); dump_readbufs();
#ifdef TIMEIT #ifdef TIMEIT
printf("%llu bytes: read cycles: " printf("%llu bytes: read cycles: "
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment