summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/main.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/main.c b/src/main.c
index 01f564b..f993b3b 100644
--- a/src/main.c
+++ b/src/main.c
@@ -59,20 +59,26 @@ _opkg_opk_main_extract(const char *file_name, const char *outer_member,
file.file = fopen(file_name, "rb");
if (file.file == NULL) {
+ fprintf(stderr, "Error: Failed to open file \"%s\"\n",
+ file_name);
goto error0;
}
outer_gzip = opkg_opk_gzip_init(&_opkg_opk_main_file_read, &file);
if (outer_gzip == NULL) {
+ fputs("Error: Failed to initialize\n", stderr);
goto error1;
}
outer_ustar = opkg_opk_ustar_init(outer_gzip);
if (outer_ustar == NULL) {
+ fputs("Error: Failed to initialize\n", stderr);
goto error2;
}
if (opkg_opk_ustar_seek(outer_ustar, outer_member) != OPKG_OPK_OK) {
+ fprintf(stderr, "Error: Failed to find \"%s\" in archive\n",
+ outer_member);
goto error3;
}
@@ -80,15 +86,19 @@ _opkg_opk_main_extract(const char *file_name, const char *outer_member,
(opkg_opk_gzip_read_func *) &opkg_opk_ustar_read,
outer_ustar);
if (inner_gzip == NULL) {
+ fputs("Error: Failed to initialize\n", stderr);
goto error3;
}
inner_ustar = opkg_opk_ustar_init(inner_gzip);
if (inner_ustar == NULL) {
+ fputs("Error: Failed to initialize\n", stderr);
goto error4;
}
if (inner_action(inner_ustar) != OPKG_OPK_OK) {
+ fprintf(stderr, "Error: Failed to read \"%s\" in archive\n",
+ outer_member);
goto error5;
}