diff options
Diffstat (limited to 'lib/common/writer.c')
-rw-r--r-- | lib/common/writer.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/common/writer.c b/lib/common/writer.c index 4762b82..84a98a5 100644 --- a/lib/common/writer.c +++ b/lib/common/writer.c @@ -85,19 +85,19 @@ int sqfs_writer_init(sqfs_writer_t *sqfs, const sqfs_writer_cfg_t *wrcfg) if (fstree_init(&sqfs->fs, wrcfg->fs_defaults)) goto fail_file; - sqfs->cmp = sqfs_compressor_create(&cfg); + ret = sqfs_compressor_create(&cfg, &sqfs->cmp); #ifdef WITH_LZO if (cfg.id == SQFS_COMP_LZO) { if (sqfs->cmp != NULL) sqfs_destroy(sqfs->cmp); - sqfs->cmp = lzo_compressor_create(&cfg); + ret = lzo_compressor_create(&cfg, &sqfs->cmp); } #endif - if (sqfs->cmp == NULL) { - fputs("Error creating compressor\n", stderr); + if (ret != 0) { + sqfs_perror(wrcfg->filename, "creating compressor", ret); goto fail_fs; } |