update_image.c: Fix call to progress function in handle_conflict()
authorEric Biggers <ebiggers3@gmail.com>
Thu, 22 May 2014 19:28:39 +0000 (14:28 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Thu, 22 May 2014 19:29:16 +0000 (14:29 -0500)
journaled_link() needs to be last because it commits the branch.

Also, it's supposed to check WIMLIB_ADD_FLAG_VERBOSE.

src/update_image.c

index ef53280..1e2ca6e 100644 (file)
@@ -520,7 +520,6 @@ 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;
 
@@ -528,19 +527,22 @@ handle_conflict(struct wim_dentry *branch, struct wim_dentry *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);
        }
 }