Skip to content

Commit

Permalink
Merge pull request #251 from Gottox/improve/no-auto-dir-inode
Browse files Browse the repository at this point in the history
file: remove auto search of directory inodes
  • Loading branch information
Gottox committed Jun 2, 2024
2 parents 2f8629d + f093cc5 commit 17c9258
Show file tree
Hide file tree
Showing 3 changed files with 1 addition and 11 deletions.
2 changes: 0 additions & 2 deletions libsqsh/include/sqsh_file_private.h
Original file line number Diff line number Diff line change
Expand Up @@ -207,8 +207,6 @@ SQSH_NO_EXPORT int sqsh__file_reader_cleanup(struct SqshFileReader *reader);
* file/file.c
*/

#define SQSH_AUTO_DIR_INODE UINT32_MAX

/**
* @brief The file type implementation
*/
Expand Down
8 changes: 0 additions & 8 deletions libsqsh/src/file/file.c
Original file line number Diff line number Diff line change
Expand Up @@ -214,14 +214,6 @@ sqsh__file_init(
goto out;
}

if (dir_inode == SQSH_AUTO_DIR_INODE) {
if (sqsh_file_type(inode) == SQSH_FILE_TYPE_DIRECTORY) {
dir_inode = sqsh_file_directory_parent_inode(inode);
} else {
rv = -SQSH_ERROR_NOT_A_DIRECTORY;
goto out;
}
}
inode->dir_inode = dir_inode;

rv = sqsh_archive_inode_map(archive, &inode_map);
Expand Down
2 changes: 1 addition & 1 deletion test/libsqsh/tree/traversal.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ UTEST(traversal, test_recursive_directory) {
mk_stub(&archive, payload, sizeof(payload));

struct SqshFile file = {0};
rv = sqsh__file_init(&file, &archive, 0, SQSH_AUTO_DIR_INODE);
rv = sqsh__file_init(&file, &archive, 0, 2);
ASSERT_EQ(0, rv);

struct SqshTreeTraversal traversal = {0};
Expand Down

0 comments on commit 17c9258

Please sign in to comment.