From 2d0c0153db70123a446b06e1a8b1db5f9c41632d Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Tue, 18 Dec 2012 01:01:23 -0600 Subject: [PATCH] Don't call unmount_progress_func() when no progress msgs requested --- src/mount_image.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/mount_image.c b/src/mount_image.c index 3f5c6cfc..3f1e9934 100644 --- a/src/mount_image.c +++ b/src/mount_image.c @@ -1122,6 +1122,7 @@ static int msg_unmount_request_handler(const void *_msg, int status = 0; int ret; int unmount_flags; + wimlib_progress_func_t progress_func; DEBUG("Handling unmount request msg"); @@ -1134,6 +1135,10 @@ static int msg_unmount_request_handler(const void *_msg, } unmount_flags = msg->unmount_flags; + if (msg->want_progress_messages) + progress_func = unmount_progress_func; + else + progress_func = NULL; ret = send_daemon_info_msg(wimfs_ctx->daemon_to_unmount_mq, getpid(), wimfs_ctx->mount_flags); @@ -1152,7 +1157,7 @@ static int msg_unmount_request_handler(const void *_msg, if (unmount_flags & WIMLIB_UNMOUNT_FLAG_RECOMPRESS) write_flags |= WIMLIB_WRITE_FLAG_RECOMPRESS; status = rebuild_wim(wimfs_ctx, write_flags, - unmount_progress_func); + progress_func); } } else { DEBUG("Read-only mount"); -- 2.43.0