Run NTFS tests when --without-ntfs-3g
authorEric Biggers <ebiggers3@gmail.com>
Sun, 28 Oct 2012 22:53:19 +0000 (17:53 -0500)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 28 Oct 2012 22:53:19 +0000 (17:53 -0500)
Makefile.am
src/dentry.c
src/mount.c
tests/test-imagex

index 69c360ab8062fc700f1cb4dd2100204da136840a..d2d04ea791b0d2fdfe57886a5b7c24ea16fd26dc 100644 (file)
@@ -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)
 
index ee33d1240a5a066c7b6ae28de4965c275a6fa8e5..927b3da9baa1a80628e72d3da5ee2ef6cb548fa2 100644 (file)
@@ -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;
 }
index ac56415ecd5906607e69f3e68987df7443a2bfcc..e07a11c3fbcfdfbd761d846c255302da75a811dd 100644 (file)
@@ -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))
index 2a4f7ec14f557a370fb5515888dece5eccd9352b..bd107e2158ee0fc51dc4c607505ee7f46df64944 100755 (executable)
@@ -19,7 +19,6 @@ imagex_info() {
 }
 
 cleanup() {
-       fusermount -u tmp &> /dev/null || true
        rm -rf dir* tmp* *.wim *.swm
 }
 cleanup