uid_t default_uid;
gid_t default_gid;
+
+ int status;
+ bool have_status;
};
static void init_wimfs_context(struct wimfs_context *ctx)
status = ret;
}
}
- send_unmount_finished_msg(wimfs_ctx->daemon_to_unmount_mq, status);
+ wimfs_ctx->status = status;
+ wimfs_ctx->have_status = true;
return MSG_BREAK_LOOP;
}
message_loop(wimfs_ctx->unmount_to_daemon_mq,
&daemon_msg_handler_callbacks,
&handler_ctx.hdr);
- close_message_queues(wimfs_ctx);
}
}
DEBUG("Returned from fuse_main() (ret = %d)", ret);
- if (ret)
+ if (ret) {
ret = WIMLIB_ERR_FUSE;
+ } else {
+ if (ctx.have_status)
+ ret = ctx.status;
+ else
+ ret = WIMLIB_ERR_TIMEOUT;
+ }
+ if (ctx.daemon_to_unmount_mq != (mqd_t)(-1)) {
+ send_unmount_finished_msg(ctx.daemon_to_unmount_mq, ret);
+ close_message_queues(&ctx);
+ }
/* Try to delete the staging directory if a deletion wasn't yet
* attempted due to an earlier error */
if (ctx.staging_dir_name)
delete_staging_dir(&ctx);
-
out_free_dir_copy:
FREE(dir_copy);
out_unlock:
[WIMLIB_ERR_FUSERMOUNT]
= "Could not execute the `fusermount' program, or it exited "
"with a failure status",
+ [WIMLIB_ERR_ICONV_NOT_AVAILABLE]
+ = "The iconv() function does not seem to work. "
+ "Maybe check to make sure the directory /usr/lib/gconv exists",
[WIMLIB_ERR_IMAGE_COUNT]
= "Inconsistent image count among the metadata "
"resources, the WIM header, and/or the XML data",
= "The part number or total parts of the WIM is invalid",
[WIMLIB_ERR_INVALID_RESOURCE_HASH]
= "The SHA1 message digest of a WIM resource did not match the expected value",
- [WIMLIB_ERR_ICONV_NOT_AVAILABLE]
- = "The iconv() function does not seem to work. "
- "Maybe check to make sure the directory /usr/lib/gconv exists",
[WIMLIB_ERR_INVALID_RESOURCE_SIZE]
= "A resource entry in the WIM has an invalid size",
+ [WIMLIB_ERR_INVALID_SECURITY_DATA]
+ = "The table of security descriptors in the WIM is invalid",
[WIMLIB_ERR_INVALID_UNMOUNT_MESSAGE]
= "The version of wimlib that has mounted a WIM image is incompatible with the "
"version being used to unmount it",
= "The WIM is part of a split WIM, which is not supported for this operation",
[WIMLIB_ERR_STAT]
= "Could not read the metadata for a file or directory",
+ [WIMLIB_ERR_TIMEOUT]
+ = "Timed out while waiting for a message to arrive from another process",
[WIMLIB_ERR_UNKNOWN_VERSION]
= "The WIM file is marked with an unknown version number",
[WIMLIB_ERR_UNSUPPORTED]
* See the documentation for each wimlib function to see specifically what error
* codes can be returned by a given function, and what they mean.
*/
+/* Note: these are currently in alphabetic order, but new error codes should be
+ * added at the end to maintain a compatible ABI, except when it's being broken
+ * anyway. */
enum wimlib_error_code {
WIMLIB_ERR_SUCCESS = 0,
WIMLIB_ERR_ALREADY_LOCKED,
fi
mkdir tmp
if ! imagex mount dir.wim dir tmp; then
- error "Failed to mount test WIM read-only" \
- "Please read any error messages above before reporting this test failure."\
+ error "Failed to mount test WIM read-only. " \
+ "Please read any error messages above before reporting this test failure. "\
"Perhaps you don't have FUSE installed, or the FUSE kernel module isn't" \
"loaded, or you aren't a member of the FUSE group?"
fi