aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/fstree/fstree_from_file.c15
-rw-r--r--mkfs/mkfs.c9
2 files changed, 1 insertions, 23 deletions
diff --git a/lib/fstree/fstree_from_file.c b/lib/fstree/fstree_from_file.c
index ec2f941..59e3833 100644
--- a/lib/fstree/fstree_from_file.c
+++ b/lib/fstree/fstree_from_file.c
@@ -57,23 +57,10 @@ static int add_device(fstree_t *fs, const char *filename, size_t line_num,
static int add_file(fstree_t *fs, const char *filename, size_t line_num,
const char *path, struct stat *basic, const char *extra)
{
- struct stat sb;
-
if (extra == NULL || *extra == '\0')
extra = path;
- if (stat(extra, &sb) != 0) {
- fprintf(stderr, "%s: %zu: stat %s: %s\n", filename, line_num,
- extra, strerror(errno));
- return -1;
- }
-
- sb.st_uid = basic->st_uid;
- sb.st_gid = basic->st_gid;
- sb.st_mode = basic->st_mode;
- sb.st_mtim = basic->st_mtim;
-
- return add_generic(fs, filename, line_num, path, &sb, extra);
+ return add_generic(fs, filename, line_num, path, basic, extra);
}
static const struct {
diff --git a/mkfs/mkfs.c b/mkfs/mkfs.c
index 2facc51..fe3fa02 100644
--- a/mkfs/mkfs.c
+++ b/mkfs/mkfs.c
@@ -143,18 +143,9 @@ static int read_fstree(fstree_t *fs, options_t *opt, sqfs_xattr_writer_t *xwr,
return -1;
}
- if (set_working_dir(opt)) {
- fclose(fp);
- return -1;
- }
-
ret = fstree_from_file(fs, opt->infile, fp);
-
fclose(fp);
- if (restore_working_dir(opt))
- return -1;
-
if (ret == 0 && selinux_handle != NULL)
ret = relabel_tree_dfs(xwr, fs->root, selinux_handle);