+ return 0;
+}
+
+static void free_message_queue_names()
+{
+ FREE(unmount_to_daemon_mq_name);
+ FREE(daemon_to_unmount_mq_name);
+ unmount_to_daemon_mq_name = NULL;
+ daemon_to_unmount_mq_name = NULL;
+}
+
+/*
+ * Opens two POSIX message queue: one for sending messages from the unmount
+ * process to the daemon process, and one to go the other way. The names of the
+ * message queues, which must be system-wide unique, are be based on the mount
+ * point. (There of course is still a possibility of a collision if one were to
+ * unmount two identically named directories simultaneously...)
+ *
+ * @daemon specifies whether the calling process is the filesystem daemon or the
+ * unmount process.
+ */
+static int open_message_queues(bool daemon)
+{
+ int flags;
+ int ret;
+
+ wimlib_assert(unmount_to_daemon_mq_name != NULL &&
+ daemon_to_unmount_mq_name != NULL);