diff options
-rw-r--r-- | include/fstree.h | 2 | ||||
-rw-r--r-- | lib/common/serialize_fstree.c | 4 | ||||
-rw-r--r-- | lib/fstree/mknode.c | 2 | ||||
-rw-r--r-- | tests/fstree_from_file.c | 4 | ||||
-rw-r--r-- | tests/mknode_simple.c | 4 | ||||
-rw-r--r-- | tests/mknode_slink.c | 12 |
6 files changed, 14 insertions, 14 deletions
diff --git a/include/fstree.h b/include/fstree.h index 4ff8c5f..1ac3f8b 100644 --- a/include/fstree.h +++ b/include/fstree.h @@ -72,7 +72,7 @@ struct tree_node_t { union { dir_info_t dir; file_info_t file; - char *slink_target; + char *target; sqfs_u64 devno; } data; diff --git a/lib/common/serialize_fstree.c b/lib/common/serialize_fstree.c index 0f34d7d..a64d90f 100644 --- a/lib/common/serialize_fstree.c +++ b/lib/common/serialize_fstree.c @@ -17,7 +17,7 @@ static sqfs_inode_generic_t *tree_node_to_inode(tree_node_t *node) size_t extra = 0; if (S_ISLNK(node->mode)) - extra = strlen(node->data.slink_target); + extra = strlen(node->data.target); inode = calloc(1, sizeof(*inode) + extra); if (inode == NULL) { @@ -39,7 +39,7 @@ static sqfs_inode_generic_t *tree_node_to_inode(tree_node_t *node) inode->data.slink.nlink = 1; inode->data.slink.target_size = extra; inode->slink_target = (char *)inode->extra; - memcpy(inode->extra, node->data.slink_target, extra); + memcpy(inode->extra, node->data.target, extra); break; case S_IFBLK: inode->base.type = SQFS_INODE_BDEV; diff --git a/lib/fstree/mknode.c b/lib/fstree/mknode.c index 6274ba7..16cfa9c 100644 --- a/lib/fstree/mknode.c +++ b/lib/fstree/mknode.c @@ -60,7 +60,7 @@ tree_node_t *fstree_mknode(tree_node_t *parent, const char *name, break; case S_IFLNK: n->mode = S_IFLNK | 0777; - n->data.slink_target = ptr; + n->data.target = ptr; break; case S_IFBLK: case S_IFCHR: diff --git a/tests/fstree_from_file.c b/tests/fstree_from_file.c index eccd1f4..e9b56be 100644 --- a/tests/fstree_from_file.c +++ b/tests/fstree_from_file.c @@ -90,8 +90,8 @@ int main(void) assert(n->uid == 2); assert(n->gid == 3); assert(strcmp(n->name, "slink") == 0); - fprintf(stderr, "'%s'\n", n->data.slink_target); - assert(strcmp(n->data.slink_target, "slinktarget") == 0); + fprintf(stderr, "'%s'\n", n->data.target); + assert(strcmp(n->data.target, "slinktarget") == 0); n = n->next; assert(n->mode == (S_IFSOCK | 0555)); diff --git a/tests/mknode_simple.c b/tests/mknode_simple.c index e77f4ff..4b4e4aa 100644 --- a/tests/mknode_simple.c +++ b/tests/mknode_simple.c @@ -33,7 +33,7 @@ int main(void) assert(node->gid == sb.st_gid); assert(node->mode == sb.st_mode); assert(node->parent == NULL); - assert(node->data.slink_target == NULL); + assert(node->data.target == NULL); assert(node->data.devno == 0); free(node); @@ -52,7 +52,7 @@ int main(void) assert(node->gid == sb.st_gid); assert(node->mode == sb.st_mode); assert(node->parent == NULL); - assert(node->data.slink_target == NULL); + assert(node->data.target == NULL); assert(node->data.devno == 0); free(node); diff --git a/tests/mknode_slink.c b/tests/mknode_slink.c index 20cf38a..a520e70 100644 --- a/tests/mknode_slink.c +++ b/tests/mknode_slink.c @@ -32,10 +32,10 @@ int main(void) assert(node->mode == (S_IFLNK | 0777)); assert(node->parent == NULL); assert((char *)node->name >= (char *)node->payload); - assert(node->data.slink_target >= (char *)node->payload); - assert(node->data.slink_target >= node->name + 8); + assert(node->data.target >= (char *)node->payload); + assert(node->data.target >= node->name + 8); assert(strcmp(node->name, "symlink") == 0); - assert(strcmp(node->data.slink_target, "target") == 0); + assert(strcmp(node->data.target, "target") == 0); free(node); node = fstree_mknode(NULL, "symlink", 7, "", &sb); @@ -44,10 +44,10 @@ int main(void) assert(node->mode == (S_IFLNK | 0777)); assert(node->parent == NULL); assert((char *)node->name >= (char *)node->payload); - assert(node->data.slink_target >= (char *)node->payload); - assert(node->data.slink_target >= node->name + 8); + assert(node->data.target >= (char *)node->payload); + assert(node->data.target >= node->name + 8); assert(strcmp(node->name, "symlink") == 0); - assert(node->data.slink_target[0] == '\0'); + assert(node->data.target[0] == '\0'); free(node); return EXIT_SUCCESS; |