diff options
Diffstat (limited to 'extras')
-rw-r--r-- | extras/browse.c | 5 | ||||
-rw-r--r-- | extras/extract_one.c | 6 | ||||
-rw-r--r-- | extras/list_files.c | 5 | ||||
-rw-r--r-- | extras/mk42sqfs.c | 3 | ||||
-rw-r--r-- | extras/mknastyfs.c | 3 |
5 files changed, 9 insertions, 13 deletions
diff --git a/extras/browse.c b/extras/browse.c index c0c9995..a608021 100644 --- a/extras/browse.c +++ b/extras/browse.c @@ -506,9 +506,8 @@ int main(int argc, char **argv) return EXIT_FAILURE; } - file = sqfs_open_file(argv[1], SQFS_FILE_OPEN_READ_ONLY); - if (file == NULL) { - perror(argv[1]); + if (sqfs_file_open(&file, argv[1], SQFS_FILE_OPEN_READ_ONLY)) { + fprintf(stderr, "%s: error opening file.\n", argv[1]); return EXIT_FAILURE; } diff --git a/extras/extract_one.c b/extras/extract_one.c index 63c83f9..d0fe1b9 100644 --- a/extras/extract_one.c +++ b/extras/extract_one.c @@ -43,9 +43,9 @@ int main(int argc, char **argv) return EXIT_FAILURE; } - file = sqfs_open_file(argv[1], SQFS_FILE_OPEN_READ_ONLY); - if (file == NULL) { - perror(argv[1]); + ret = sqfs_file_open(&file, argv[1], SQFS_FILE_OPEN_READ_ONLY); + if (ret) { + fprintf(stderr, "%s: error opening file.\n", argv[1]); return EXIT_FAILURE; } diff --git a/extras/list_files.c b/extras/list_files.c index d1e0a64..89a1f30 100644 --- a/extras/list_files.c +++ b/extras/list_files.c @@ -70,9 +70,8 @@ int main(int argc, char **argv) return EXIT_FAILURE; } - file = sqfs_open_file(argv[1], SQFS_FILE_OPEN_READ_ONLY); - if (file == NULL) { - perror(argv[1]); + if (sqfs_file_open(&file, argv[1], SQFS_FILE_OPEN_READ_ONLY)) { + fprintf(stderr, "%s: error opening file.\n", argv[1]); return EXIT_FAILURE; } diff --git a/extras/mk42sqfs.c b/extras/mk42sqfs.c index 87e1523..abad4b4 100644 --- a/extras/mk42sqfs.c +++ b/extras/mk42sqfs.c @@ -71,8 +71,7 @@ int main(int argc, char **argv) (void)argc; (void)argv; /* get a file object referring to our destination file */ - file = sqfs_open_file("42.sqfs", SQFS_FILE_OPEN_OVERWRITE); - if (file == NULL) { + if (sqfs_file_open(&file, "42.sqfs", SQFS_FILE_OPEN_OVERWRITE)) { fputs("Error opening output file.\n", stderr); return EXIT_FAILURE; } diff --git a/extras/mknastyfs.c b/extras/mknastyfs.c index c72bd7d..5984828 100644 --- a/extras/mknastyfs.c +++ b/extras/mknastyfs.c @@ -66,8 +66,7 @@ int main(int argc, char **argv) (void)argc; (void)argv; /* get a file object referring to our destination file */ - file = sqfs_open_file("nasty.sqfs", 0); - if (file == NULL) { + if (sqfs_file_open(&file, "nasty.sqfs", 0)) { fputs("Error opening output file.\n", stderr); return EXIT_FAILURE; } |