+fflush_and_ftruncate(FILE *out_fp, off_t offset)
+{
+ if (fseeko(out_fp, offset, SEEK_SET) ||
+ fflush(out_fp) ||
+ ftruncate(fileno(out_fp), offset))
+ {
+ ERROR_WITH_ERRNO("Failed to flush and/or truncate "
+ "output WIM file");
+ return WIMLIB_ERR_WRITE;
+ } else {
+ return 0;
+ }
+}
+
+static int
+finalize_and_check_sha1(SHA_CTX * restrict sha_ctx,
+ struct wim_lookup_table_entry * restrict lte)