X-Git-Url: https://wimlib.net/git/?a=blobdiff_plain;f=src%2Fmount_image.c;h=6a38dc33e8cabbfb7b0dce837052a18bc28650a9;hb=c0f8b57abbe88037a167e3919dfa1e48162fdb05;hp=3f1e9934961cee526b727899adefe86f488726d5;hpb=2d0c0153db70123a446b06e1a8b1db5f9c41632d;p=wimlib diff --git a/src/mount_image.c b/src/mount_image.c index 3f1e9934..6a38dc33 100644 --- a/src/mount_image.c +++ b/src/mount_image.c @@ -1017,7 +1017,6 @@ enum { }; struct msg_handler_context { - bool is_daemon; int timeout_seconds; union { struct { @@ -1108,7 +1107,8 @@ static int unmount_progress_func(enum wimlib_progress_msg msg, if (mq_send(wimfs_get_context()->daemon_to_unmount_mq, (void*)&msg, sizeof(msg), 1)) { - ERROR_WITH_ERRNO("Failed to send status to unmount process"); + ERROR_WITH_ERRNO("Failed to send progress information " + "to unmount process"); } } return 0; @@ -1241,7 +1241,8 @@ out_crashed: static int daemon_timed_out_cb(struct msg_handler_context *handler_ctx) { - DEBUG("Timed out"); + ERROR("Timed out waiting for unmount request! " + "Changes to the mounted WIM will not be committed."); return WIMLIB_ERR_TIMEOUT; } @@ -1456,26 +1457,19 @@ static int wimfs_chmod(const char *path, mode_t mask) /* Called when the filesystem is unmounted. */ static void wimfs_destroy(void *p) { - struct wimfs_context *wimfs_ctx; - - wimfs_ctx = wimfs_get_context(); - - if (open_message_queues(wimfs_ctx, true)) - return; - - struct msg_handler_context handler_ctx = { - .is_daemon = true, - .timeout_seconds = 5, - .daemon = { - .wimfs_ctx = wimfs_ctx, - }, - }; - - message_loop(wimfs_ctx->unmount_to_daemon_mq, - &daemon_msg_handler_callbacks, - &handler_ctx); - - close_message_queues(wimfs_ctx); + struct wimfs_context *wimfs_ctx = wimfs_get_context(); + if (open_message_queues(wimfs_ctx, true) == 0) { + struct msg_handler_context handler_ctx = { + .timeout_seconds = 5, + .daemon = { + .wimfs_ctx = wimfs_ctx, + }, + }; + message_loop(wimfs_ctx->unmount_to_daemon_mq, + &daemon_msg_handler_callbacks, + &handler_ctx); + close_message_queues(wimfs_ctx); + } } #if 0 @@ -2523,7 +2517,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,