From 4b4cee0c0c99f531a45157fd27f5441e511db109 Mon Sep 17 00:00:00 2001 From: David Oberhollenzer Date: Fri, 25 Sep 2020 21:06:59 +0200 Subject: Replace file/getline usage with istream Signed-off-by: David Oberhollenzer --- bin/gensquashfs/Makemodule.am | 2 +- bin/gensquashfs/mkfs.c | 10 +--------- 2 files changed, 2 insertions(+), 10 deletions(-) (limited to 'bin') 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, -- cgit v1.2.3