+ mount_dir = dir;
+
+ /* Open message queues between the unmount process and the
+ * filesystem daemon. */
+ ret = open_message_queues(false);
+ if (ret != 0)
+ return ret;
+
+ /* Send a message to the filesystem saying whether to commit or
+ * not. */
+ msg[0] = (flags & WIMLIB_UNMOUNT_FLAG_COMMIT) ? 1 : 0;
+ msg[1] = (flags & WIMLIB_UNMOUNT_FLAG_CHECK_INTEGRITY) ? 1 : 0;
+
+ DEBUG("Sending message: %s, %s",
+ (msg[0] == 0) ? "don't commit" : "commit",
+ (msg[1] == 0) ? "don't check" : "check");
+ ret = mq_send(unmount_to_daemon_mq, msg, 2, 1);
+ if (ret == -1) {
+ ERROR("Failed to notify filesystem daemon whether we want to "
+ "commit changes or not");
+ close_message_queues();
+ return WIMLIB_ERR_MQUEUE;
+ }
+