Update CRC-32 implementation.
[bluesky.git] / bluesky / log.c
index e79b21b..a3acf10 100644 (file)
@@ -616,8 +616,11 @@ static gboolean validate_journal_item(const char *buf, size_t len, off_t offset)
     uint32_t crc = crc32c(BLUESKY_CRC32C_SEED, buf + offset,
                           sizeof(struct log_header) + sizeof(struct log_footer)
                           + size);
-    if (crc != 0)
+    if (crc != BLUESKY_CRC32C_VALIDATOR) {
+        g_warning("Journal entry failed to validate: CRC %08x != %08x",
+                  crc, BLUESKY_CRC32C_VALIDATOR);
         return FALSE;
+    }
 
     return TRUE;
 }