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)
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;
}
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;
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))
}
cleanup() {
- fusermount -u tmp &> /dev/null || true
rm -rf dir* tmp* *.wim *.swm
}
cleanup