diff options
author | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-29 01:04:37 +0200 |
---|---|---|
committer | David Oberhollenzer <david.oberhollenzer@sigma-star.at> | 2019-09-29 01:46:39 +0200 |
commit | db519e0d3a9fd5a8c35d66341b37def7be813d89 (patch) | |
tree | 1927ac8e1d47849d72d0bd464a826952d1f5f5e1 /lib/fstree/fstree_from_file.c | |
parent | 25ccdd1aed35f5ed538cc886e554819d3e918c3e (diff) |
Cleanup: fstree_from_file does not need to change working directory
The file_info_t no longer stores the size or other such information,
so there is no need to do a stat on the input file. This also means
that gensquashfs no longer needs to change the working directory when
using the function.
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'lib/fstree/fstree_from_file.c')
-rw-r--r-- | lib/fstree/fstree_from_file.c | 15 |
1 files changed, 1 insertions, 14 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 { |