-static int
-send_unmount_request_msg(mqd_t mq, int unmount_flags, u8 want_progress_messages)
-{
- DEBUG("Sending unmount request msg");
- struct msg_unmount_request msg = {
- .hdr = {
- .min_version = ((unmount_flags & WIMLIB_UNMOUNT_FLAG_NEW_IMAGE) ?
- WIMLIB_MAKEVERSION(1, 6, 2) :
- WIMLIB_MAKEVERSION(1, 2, 1)),
- .cur_version = WIMLIB_VERSION_CODE,
- .msg_type = MSG_TYPE_UNMOUNT_REQUEST,
- .msg_size = sizeof(msg),
- },
- .unmount_flags = unmount_flags,
- .want_progress_messages = want_progress_messages,
- };
-
- if (mq_send(mq, (void*)&msg, sizeof(msg), 1)) {
- ERROR_WITH_ERRNO("Failed to communicate with filesystem daemon");
- return WIMLIB_ERR_MQUEUE;
- }
- return 0;
-}
-
-static int
-send_daemon_info_msg(mqd_t mq, pid_t pid, int mount_flags)
-{
- DEBUG("Sending daemon info msg (pid = %d, mount_flags=%x)",
- pid, mount_flags);
-
- struct msg_daemon_info msg = {
- .hdr = {
- .min_version = WIMLIB_MAKEVERSION(1, 2, 1),
- .cur_version = WIMLIB_VERSION_CODE,
- .msg_type = MSG_TYPE_DAEMON_INFO,
- .msg_size = sizeof(msg),
- },
- .daemon_pid = pid,
- .mount_flags = mount_flags,
- };
- if (mq_send(mq, (void*)&msg, sizeof(msg), 1)) {
- ERROR_WITH_ERRNO("Failed to send daemon info to unmount process");
- return WIMLIB_ERR_MQUEUE;
- }
- return 0;