From 29a09c1a5c20e1b04cc11ef24f5863bf8db7796c Mon Sep 17 00:00:00 2001 From: Eric Biggers Date: Sun, 28 Oct 2012 17:53:19 -0500 Subject: [PATCH 1/1] Run NTFS tests when --without-ntfs-3g --- Makefile.am | 7 +++++-- src/dentry.c | 9 +++++---- src/mount.c | 6 +++--- tests/test-imagex | 1 - 4 files changed, 13 insertions(+), 10 deletions(-) diff --git a/Makefile.am b/Makefile.am index 69c360ab..d2d04ea7 100644 --- a/Makefile.am +++ b/Makefile.am @@ -125,8 +125,11 @@ tests_tree_cmp_SOURCES = tests/tree-cmp.c dist_check_SCRIPTS = tests/test-imagex \ tests/test-imagex-mount \ - tests/test-imagex-capture_and_apply \ - tests/test-imagex-ntfs + tests/test-imagex-capture_and_apply + +if WITH_NTFS_3G +dist_check_SCRIPTS += tests/test-imagex-ntfs +endif TESTS = $(dist_check_SCRIPTS) diff --git a/src/dentry.c b/src/dentry.c index ee33d124..927b3da9 100644 --- a/src/dentry.c +++ b/src/dentry.c @@ -424,21 +424,22 @@ struct dentry *get_dentry_child_with_name(const struct dentry *dentry, static struct dentry *get_dentry_relative_path(struct dentry *cur_dir, const char *path) { - struct dentry *child; + struct dentry *child, *children; size_t base_len; const char *new_path; if (*path == '\0') return cur_dir; - child = cur_dir->d_inode->children; - if (child) { + children = cur_dir->d_inode->children; + if (children) { new_path = path_next_part(path, &base_len); + child = children; do { if (dentry_has_name(child, path, base_len)) return get_dentry_relative_path(child, new_path); child = child->next; - } while (child != cur_dir->d_inode->children); + } while (child != children); } return NULL; } diff --git a/src/mount.c b/src/mount.c index ac56415e..e07a11c3 100644 --- a/src/mount.c +++ b/src/mount.c @@ -956,7 +956,7 @@ static int wimfs_ftruncate(const char *path, off_t size, struct wimlib_fd *fd = (struct wimlib_fd*)(uintptr_t)fi->fh; int ret = ftruncate(fd->staging_fd, size); if (ret != 0) - return ret; + return -errno; if (fd->f_lte && size < fd->f_lte->resource_entry.original_size) fd->f_lte->resource_entry.original_size = size; return 0; @@ -1249,9 +1249,9 @@ static int wimfs_opendir(const char *path, struct fuse_file_info *fi) struct inode *inode; int ret; struct wimlib_fd *fd = NULL; - struct wimfs_context *ctx = wimfs_get_context(); + WIMStruct *w = wimfs_get_WIMStruct(); - inode = wim_pathname_to_inode(ctx->wim, path); + inode = wim_pathname_to_inode(w, path); if (!inode) return -ENOENT; if (!inode_is_directory(inode)) diff --git a/tests/test-imagex b/tests/test-imagex index 2a4f7ec1..bd107e21 100755 --- a/tests/test-imagex +++ b/tests/test-imagex @@ -19,7 +19,6 @@ imagex_info() { } cleanup() { - fusermount -u tmp &> /dev/null || true rm -rf dir* tmp* *.wim *.swm } cleanup -- 2.43.0