Update invalid environment variable handling to actually fail rather than auto-correct.

This commit is contained in:
Moinak Ghosh 2013-05-28 21:38:35 +05:30
parent e9ce7a5ed2
commit ab1ced942d

View file

@ -227,8 +227,10 @@ create_dedupe_context(uint64_t chunksize, uint64_t real_chunksize, int rab_blk_s
if ((ck = getenv("PCOMPRESS_CHUNK_HASH_GLOBAL")) != NULL) {
if (get_checksum_props(ck, &chunk_cksum, &cksum_bytes, &mac_bytes, 1) != 0 ||
strcmp(ck, "CRC64") == 0) {
fprintf(stderr, "Invalid PCOMPRESS_CHUNK_HASH_GLOBAL. Reverting to default.\n");
chunk_cksum = 0;
fprintf(stderr, "Invalid PCOMPRESS_CHUNK_HASH_GLOBAL.\n");
chunk_cksum = -1;
pthread_mutex_unlock(&init_lock);
return (NULL);
}
}
if (chunk_cksum == 0) {