int ret;
u32 new_table_size;
+ DEBUG("Writing integrity table "
+ "(new_lookup_table_end=%"PRIu64", old_lookup_table_end=%"PRIu64")",
+ new_lookup_table_end, old_lookup_table_end);
+
wimlib_assert(old_lookup_table_end <= new_lookup_table_end);
old_table = NULL;
FREE(new_table);
out_free_old_table:
FREE(old_table);
+ DEBUG("ret=%d", ret);
return ret;
}
{
int ret = 0;
- if (!(write_flags & WIMLIB_WRITE_FLAG_FILE_DESCRIPTOR))
+ if (!(write_flags & WIMLIB_WRITE_FLAG_FILE_DESCRIPTOR)) {
+ DEBUG("Closing WIM file.");
if (filedes_valid(&wim->out_fd))
if (filedes_close(&wim->out_fd))
ret = WIMLIB_ERR_WRITE;
+ }
filedes_invalidate(&wim->out_fd);
return ret;
}
off_t new_lookup_table_end;
u64 xml_totalbytes;
+ DEBUG("image=%d, write_flags=%08x", image, write_flags);
+
write_resource_flags = write_flags_to_resource_flags(write_flags);
/* In the WIM header, there is room for the resource entry for a
hdr_offset = 0;
if (write_flags & WIMLIB_WRITE_FLAG_HEADER_AT_END)
hdr_offset = wim->out_fd.offset;
+ DEBUG("Writing new header @ %"PRIu64".", hdr_offset);
ret = write_wim_header_at_offset(&wim->hdr, &wim->out_fd, hdr_offset);
if (ret)
return ret;
* operation has been written to disk, but the new file data has not.
*/
if (write_flags & WIMLIB_WRITE_FLAG_FSYNC) {
+ DEBUG("Syncing WIM file.");
if (fsync(wim->out_fd.fd)) {
ERROR_WITH_ERRNO("Error syncing data to WIM file");
return WIMLIB_ERR_WRITE;
out_restore_hdr:
memcpy(&wim->hdr, &hdr_save, sizeof(struct wim_header));
(void)close_wim_writable(wim, write_flags);
+ DEBUG("ret=%d", ret);
return ret;
}
if (rc < 0)
return rc;
- return xmlTextWriterEndElement(writer); /* </VERSION> */
+ rc = xmlTextWriterEndElement(writer); /* </VERSION> */
+ if (rc < 0)
+ return rc;
+
+ return 0;
}
/* Writes the information contained in a `struct windows_info' to the XML
if (windows_info->windows_version_exists) {
rc = xml_write_windows_version(writer, &windows_info->windows_version);
- if (rc < 0)
+ if (rc)
return rc;
}
- rc = xml_write_string(writer, "SYSTEMROOT",
- windows_info->system_root);
+ rc = xml_write_string(writer, "SYSTEMROOT", windows_info->system_root);
if (rc)
return rc;
- return xmlTextWriterEndElement(writer); /* </WINDOWS> */
+ rc = xmlTextWriterEndElement(writer); /* </WINDOWS> */
+ if (rc < 0)
+ return rc;
+
+ return 0;
}
/* Writes a time element to the XML document being constructed in memory. */
rc = xmlTextWriterEndElement(writer); /* </IMAGE> */
if (rc < 0)
return rc;
+
return 0;
}
out_buffer_free:
xmlBufferFree(buf);
out:
+ DEBUG("ret=%d", ret);
return ret;
out_write_error:
write_resource_flags,
&wim->lzx_context);
FREE(xml_data);
+ DEBUG("ret=%d");
return ret;
}