]> wimlib.net Git - wimlib/blobdiff - src/update_image.c
Remove some dead assignments
[wimlib] / src / update_image.c
index ef5328059be12fc45fc0ff750c484d8ddf8b75a3..040afb6b732b8fe4b56daeb5fab7f70df97b213d 100644 (file)
@@ -212,13 +212,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 +362,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 +520,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 +936,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 +983,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 +1152,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,