if (wim) {
wim->in_fd.fd = -1;
wim->out_fd.fd = -1;
+ INIT_LIST_HEAD(&wim->subwims);
}
- INIT_LIST_HEAD(&wim->subwims);
return wim;
}
* intervening time...
*
* Warning: in Windows native builds, realpath() calls the
- * replacement function in win32.c.
+ * replacement function in win32_replacements.c.
*/
wim->filename = realpath(wimfile, NULL);
if (!wim->filename) {
return ret;
}
- if (wim->hdr.total_parts != 1 && !(open_flags & WIMLIB_OPEN_FLAG_SPLIT_OK)) {
- ERROR("\"%"TS"\": This WIM is part %u of a %u-part WIM",
- wimfile, wim->hdr.part_number, wim->hdr.total_parts);
- return WIMLIB_ERR_SPLIT_UNSUPPORTED;
- }
+ if ((open_flags & WIMLIB_OPEN_FLAG_ERROR_IF_SPLIT) &&
+ (wim->hdr.total_parts != 1))
+ return WIMLIB_ERR_IS_SPLIT_WIM;
DEBUG("According to header, WIM contains %u images", wim->hdr.image_count);
wim_checksum_unhashed_streams(WIMStruct *wim)
{
int ret;
+
+ if (!wim_has_metadata(wim))
+ return 0;
for (int i = 0; i < wim->hdr.image_count; i++) {
struct wim_lookup_table_entry *lte, *tmp;
struct wim_image_metadata *imd = wim->image_metadata[i];
}
}
if (wim->hdr.total_parts != 1) {
- ERROR("Cannot modify \"%"TS"\": is part of a spanned set",
+ ERROR("Cannot modify \"%"TS"\": is part of a split WIM",
wim->filename);
return WIMLIB_ERR_WIM_IS_READONLY;
}