X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fupdate_image.c;h=2577e037faa145adcb1bd557543d5b670c72b9ed;hb=19383e489030b926c9816699a13b81b36bb766b1;hp=ef5328059be12fc45fc0ff750c484d8ddf8b75a3;hpb=b5b9681794d1f5f13350e3567f6f6e74f5c779cf;p=wimlib diff --git a/src/update_image.c b/src/update_image.c index ef532805..2577e037 100644 --- a/src/update_image.c +++ b/src/update_image.c @@ -28,6 +28,7 @@ #include "wimlib/capture.h" #include "wimlib/dentry.h" #include "wimlib/encoding.h" +#include "wimlib/endianness.h" #include "wimlib/error.h" #include "wimlib/lookup_table.h" #include "wimlib/metadata.h" @@ -212,13 +213,13 @@ do_unlink(struct wim_dentry *subject, struct wim_dentry *parent, { if (parent) { /* Unlink @subject from its @parent. */ - wimlib_assert(subject->parent == parent); + wimlib_assert(subject->d_parent == parent); unlink_dentry(subject); } else { /* Unset @subject as the root of the image. */ *root_p = NULL; } - subject->parent = subject; + subject->d_parent = subject; } static void @@ -362,7 +363,7 @@ journaled_unlink(struct update_command_journal *j, struct wim_dentry *subject) if (dentry_is_root(subject)) parent = NULL; else - parent = subject->parent; + parent = subject->d_parent; prim.type = UNLINK_DENTRY; prim.link.subject = subject; @@ -520,27 +521,29 @@ handle_conflict(struct wim_dentry *branch, struct wim_dentry *existing, /* Replace nondirectory file */ struct wim_dentry *parent; int ret; - union wimlib_progress_info info; - parent = existing->parent; + parent = existing->d_parent; ret = calculate_dentry_full_path(existing); if (ret) return ret; - ret = journaled_unlink(j, existing); - if (ret) - return ret; + if (add_flags & WIMLIB_ADD_FLAG_VERBOSE) { + union wimlib_progress_info info; + + info.replace.path_in_wim = existing->_full_path; + ret = call_progress(progfunc, + WIMLIB_PROGRESS_MSG_REPLACE_FILE_IN_WIM, + &info, progctx); + if (ret) + return ret; + } - ret = journaled_link(j, branch, parent); + ret = journaled_unlink(j, existing); if (ret) return ret; - - info.replace.path_in_wim = existing->_full_path; - return call_progress(progfunc, - WIMLIB_PROGRESS_MSG_REPLACE_FILE_IN_WIM, - &info, progctx); + return journaled_link(j, branch, parent); } } @@ -934,7 +937,7 @@ is_ancestor(const struct wim_dentry *d1, const struct wim_dentry *d2) return true; if (dentry_is_root(d2)) return false; - d2 = d2->parent; + d2 = d2->d_parent; } } @@ -981,7 +984,7 @@ rename_wim_path(WIMStruct *wim, const tchar *from, const tchar *to, if (dentry_has_children(dst)) return -ENOTEMPTY; } - parent_of_dst = dst->parent; + parent_of_dst = dst->d_parent; } else { /* Destination does not exist */ parent_of_dst = get_parent_dentry(wim, to, case_type); @@ -1150,7 +1153,6 @@ execute_update_commands(WIMStruct *wim, goto rollback; } - ret = WIMLIB_ERR_INVALID_PARAM; switch (cmds[i].op) { case WIMLIB_UPDATE_OP_ADD: ret = execute_add_command(j, wim, &cmds[i], inode_table,