aboutsummaryrefslogtreecommitdiff
path: root/bin
diff options
context:
space:
mode:
authorDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-09-25 21:06:59 +0200
committerDavid Oberhollenzer <david.oberhollenzer@sigma-star.at>2020-09-29 18:19:53 +0200
commit4b4cee0c0c99f531a45157fd27f5441e511db109 (patch)
tree825aae023f27c2f578536af35dfd01b1dc96e18e /bin
parentd87bffd89b9c0a26a65f0c629250fa87902b6cb8 (diff)
Replace file/getline usage with istream
Signed-off-by: David Oberhollenzer <david.oberhollenzer@sigma-star.at>
Diffstat (limited to 'bin')
-rw-r--r--bin/gensquashfs/Makemodule.am2
-rw-r--r--bin/gensquashfs/mkfs.c10
2 files changed, 2 insertions, 10 deletions
diff --git a/bin/gensquashfs/Makemodule.am b/bin/gensquashfs/Makemodule.am
index a9ae5b6..e030009 100644
--- a/bin/gensquashfs/Makemodule.am
+++ b/bin/gensquashfs/Makemodule.am
@@ -1,7 +1,7 @@
gensquashfs_SOURCES = bin/gensquashfs/mkfs.c bin/gensquashfs/mkfs.h
gensquashfs_SOURCES += bin/gensquashfs/options.c bin/gensquashfs/selinux.c
gensquashfs_SOURCES += bin/gensquashfs/dirscan.c bin/gensquashfs/dirscan_xattr.c
-gensquashfs_LDADD = libcommon.a libsquashfs.la libfstree.a
+gensquashfs_LDADD = libcommon.a libsquashfs.la libfstree.a libfstream.a
gensquashfs_LDADD += libcompat.a $(LZO_LIBS) $(PTHREAD_LIBS)
gensquashfs_CPPFLAGS = $(AM_CPPFLAGS)
gensquashfs_CFLAGS = $(AM_CFLAGS) $(PTHREAD_CFLAGS)
diff --git a/bin/gensquashfs/mkfs.c b/bin/gensquashfs/mkfs.c
index 66e10a9..ce23e6f 100644
--- a/bin/gensquashfs/mkfs.c
+++ b/bin/gensquashfs/mkfs.c
@@ -147,17 +147,9 @@ static int relabel_tree_dfs(const char *filename, sqfs_xattr_writer_t *xwr,
static int read_fstree(fstree_t *fs, options_t *opt, sqfs_xattr_writer_t *xwr,
void *selinux_handle)
{
- FILE *fp;
int ret;
- fp = fopen(opt->infile, "rb");
- if (fp == NULL) {
- perror(opt->infile);
- return -1;
- }
-
- ret = fstree_from_file(fs, opt->infile, fp);
- fclose(fp);
+ ret = fstree_from_file(fs, opt->infile);
if (ret == 0 && selinux_handle != NULL)
ret = relabel_tree_dfs(opt->cfg.filename, xwr,