]> wimlib.net Git - wimlib/blobdiff - src/mount_image.c
Remove is_daemon field in message handler context
[wimlib] / src / mount_image.c
index 3f5c6cfc5b5897e01c0dff69d8bb12a56dc56ce9..e361ddb8abb47a650b3befa8baf4874737843125 100644 (file)
@@ -1017,7 +1017,6 @@ enum {
 };
 
 struct msg_handler_context {
-       bool is_daemon;
        int timeout_seconds;
        union {
                struct {
@@ -1122,6 +1121,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 +1134,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 +1156,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");
@@ -1459,7 +1463,6 @@ static void wimfs_destroy(void *p)
                return;
 
        struct msg_handler_context handler_ctx = {
-               .is_daemon = true,
                .timeout_seconds = 5,
                .daemon = {
                        .wimfs_ctx = wimfs_ctx,
@@ -2518,7 +2521,6 @@ WIMLIBAPI int wimlib_unmount_image(const char *dir, int unmount_flags,
                goto out_close_message_queues;
 
        struct msg_handler_context handler_ctx = {
-               .is_daemon = false,
                .timeout_seconds = 5,
                .unmount = {
                        .daemon_pid = 0,