aboutsummaryrefslogtreecommitdiff
path: root/bin/gensquashfs/src/fstree_from_dir.c
diff options
context:
space:
mode:
Diffstat (limited to 'bin/gensquashfs/src/fstree_from_dir.c')
-rw-r--r--bin/gensquashfs/src/fstree_from_dir.c44
1 files changed, 0 insertions, 44 deletions
diff --git a/bin/gensquashfs/src/fstree_from_dir.c b/bin/gensquashfs/src/fstree_from_dir.c
deleted file mode 100644
index 40b4061..0000000
--- a/bin/gensquashfs/src/fstree_from_dir.c
+++ /dev/null
@@ -1,44 +0,0 @@
-/* SPDX-License-Identifier: GPL-3.0-or-later */
-/*
- * fstree_from_dir.c
- *
- * Copyright (C) 2019 David Oberhollenzer <goliath@infraroot.at>
- */
-#include "mkfs.h"
-
-int fstree_from_dir(fstree_t *fs, sqfs_dir_iterator_t *dir)
-{
- for (;;) {
- sqfs_dir_entry_t *ent = NULL;
- tree_node_t *n = NULL;
- char *extra = NULL;
-
- int ret = dir->next(dir, &ent);
- if (ret > 0)
- break;
- if (ret < 0) {
- sqfs_perror("readdir", NULL, ret);
- return -1;
- }
-
- if (S_ISLNK(ent->mode)) {
- ret = dir->read_link(dir, &extra);
- if (ret) {
- sqfs_perror("readlink", ent->name, ret);
- free(ent);
- return -1;
- }
- }
-
- n = fstree_add_generic(fs, ent, extra);
- free(extra);
- free(ent);
-
- if (n == NULL) {
- perror("creating tree node");
- return -1;
- }
- }
-
- return 0;
-}