aboutsummaryrefslogtreecommitdiff
path: root/extras
diff options
context:
space:
mode:
Diffstat (limited to 'extras')
-rw-r--r--extras/browse.c9
-rw-r--r--extras/list_files.c9
-rw-r--r--extras/mk42sqfs.c8
-rw-r--r--extras/mknastyfs.c8
4 files changed, 18 insertions, 16 deletions
diff --git a/extras/browse.c b/extras/browse.c
index 5b27dc6..9dd735a 100644
--- a/extras/browse.c
+++ b/extras/browse.c
@@ -477,10 +477,10 @@ static const struct {
int main(int argc, char **argv)
{
char *cmd, *arg, *buffer = NULL;
+ int ret, status = EXIT_FAILURE;
sqfs_compressor_config_t cfg;
sqfs_compressor_t *cmp;
sqfs_file_t *file;
- int status = EXIT_FAILURE;
size_t i;
/* open the SquashFS file we want to read */
@@ -511,9 +511,10 @@ int main(int argc, char **argv)
super.block_size,
SQFS_COMP_FLAG_UNCOMPRESS);
- cmp = sqfs_compressor_create(&cfg);
- if (cmp == NULL) {
- fprintf(stderr, "%s: error creating compressor.\n", argv[1]);
+ ret = sqfs_compressor_create(&cfg, &cmp);
+ if (ret != 0) {
+ fprintf(stderr, "%s: error creating compressor: %d.\n",
+ argv[1], ret);
goto out_fd;
}
diff --git a/extras/list_files.c b/extras/list_files.c
index 5e181f2..eba4fff 100644
--- a/extras/list_files.c
+++ b/extras/list_files.c
@@ -47,6 +47,7 @@ static void write_tree_dfs(const sqfs_tree_node_t *n)
int main(int argc, char **argv)
{
+ int ret, status = EXIT_FAILURE;
sqfs_compressor_config_t cfg;
sqfs_compressor_t *cmp;
sqfs_tree_node_t *root = NULL;
@@ -54,7 +55,6 @@ int main(int argc, char **argv)
sqfs_dir_reader_t *dr;
sqfs_file_t *file;
sqfs_super_t super;
- int status = EXIT_FAILURE;
/* open the SquashFS file we want to read */
if (argc != 2) {
@@ -84,9 +84,10 @@ int main(int argc, char **argv)
super.block_size,
SQFS_COMP_FLAG_UNCOMPRESS);
- cmp = sqfs_compressor_create(&cfg);
- if (cmp == NULL) {
- fprintf(stderr, "%s: error creating compressor.\n", argv[1]);
+ ret = sqfs_compressor_create(&cfg, &cmp);
+ if (ret != 0) {
+ fprintf(stderr, "%s: error creating compressor: %d.\n",
+ argv[1], ret);
goto out_fd;
}
diff --git a/extras/mk42sqfs.c b/extras/mk42sqfs.c
index e7c5357..92323e0 100644
--- a/extras/mk42sqfs.c
+++ b/extras/mk42sqfs.c
@@ -50,10 +50,10 @@ static sqfs_inode_generic_t *create_file_inode(sqfs_id_table_t *idtbl,
int main(void)
{
sqfs_meta_writer_t *inode_m, *dir_m;
+ int ret, status = EXIT_FAILURE;
sqfs_compressor_config_t cfg;
sqfs_inode_generic_t *inode;
unsigned int i, inode_num;
- int status = EXIT_FAILURE;
sqfs_dir_writer_t *dirwr;
sqfs_compressor_t *cmp;
sqfs_id_table_t *idtbl;
@@ -88,9 +88,9 @@ int main(void)
sqfs_compressor_config_init(&cfg, super.compression_id,
super.block_size, 0);
- cmp = sqfs_compressor_create(&cfg);
- if (cmp == NULL) {
- fputs("Error creating compressor.\n", stderr);
+ ret = sqfs_compressor_create(&cfg, &cmp);
+ if (ret != 0) {
+ fprintf(stderr, "Error creating compressor: %d.\n", ret);
goto out_file;
}
diff --git a/extras/mknastyfs.c b/extras/mknastyfs.c
index 7ec3ee0..daadf37 100644
--- a/extras/mknastyfs.c
+++ b/extras/mknastyfs.c
@@ -46,9 +46,9 @@ static sqfs_inode_generic_t *create_file_inode(sqfs_id_table_t *idtbl,
int main(void)
{
sqfs_meta_writer_t *inode_m, *dir_m;
+ int ret, status = EXIT_FAILURE;
sqfs_compressor_config_t cfg;
sqfs_inode_generic_t *inode;
- int status = EXIT_FAILURE;
sqfs_dir_writer_t *dirwr;
sqfs_compressor_t *cmp;
sqfs_id_table_t *idtbl;
@@ -77,9 +77,9 @@ int main(void)
sqfs_compressor_config_init(&cfg, super.compression_id,
super.block_size, 0);
- cmp = sqfs_compressor_create(&cfg);
- if (cmp == NULL) {
- fputs("Error creating compressor.\n", stderr);
+ ret = sqfs_compressor_create(&cfg, &cmp);
+ if (ret != 0) {
+ fprintf(stderr, "Error creating compressor: %d.\n", ret);
goto out_file;
}