From 44b71e2fbcb28a20ab33b239a5ac723243390e90 Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Thu, 22 May 2014 14:28:39 -0500 Subject: [PATCH] update_image.c: Fix call to progress function in handle_conflict() 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 | 22 ++++++++++++---------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/src/update_image.c b/src/update_image.c index ef532805..1e2ca6e8 100644 --- a/src/update_image.c +++ b/src/update_image.c @@ -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); } } -- 2.43.0