diff options
Diffstat (limited to 'bin/rdsquashfs/src/fill_files.c')
-rw-r--r-- | bin/rdsquashfs/src/fill_files.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/bin/rdsquashfs/src/fill_files.c b/bin/rdsquashfs/src/fill_files.c index e692ee3..f0ad7e2 100644 --- a/bin/rdsquashfs/src/fill_files.c +++ b/bin/rdsquashfs/src/fill_files.c @@ -145,9 +145,11 @@ static int fill_files(sqfs_data_reader_t *data, int flags) openflags |= SQFS_FILE_OPEN_NO_SPARSE; for (i = 0; i < num_files; ++i) { - fp = ostream_open_file(files[i].path, openflags); - if (fp == NULL) + ret = ostream_open_file(&fp, files[i].path, openflags); + if (ret) { + sqfs_perror(files[i].path, NULL, ret); return -1; + } if (!(flags & UNPACK_QUIET)) printf("unpacking %s\n", files[i].path); @@ -157,9 +159,13 @@ static int fill_files(sqfs_data_reader_t *data, int flags) if (ret == 0) ret = fp->flush(fp); - sqfs_drop(fp); - if (ret) + if (ret) { + sqfs_perror(files[i].path, "unpacking", ret); + sqfs_drop(fp); return -1; + } + + sqfs_drop(fp); } return 0; |