diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2023-04-17 10:32:47 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2023-04-17 10:32:47 (EDT) |
commit | 652b5a0bb66c90b8235cca1ef67e84a55a83d90a (patch) | |
tree | 67817a475a8a9e6f7b5fcd886dd422766e643fc1 /src | |
parent | 53c6f9fb43624e4d48ef3a624dfe9511ef631c0e (diff) |
main: Improve error messages about inner archive
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 9 |
1 files changed, 6 insertions, 3 deletions
@@ -97,8 +97,6 @@ _opkg_opk_main_extract(const char *file_name, const char *outer_member, } if (inner_action(inner_ustar) != OPKG_OPK_OK) { - fprintf(stderr, "Error: Failed to read \"%s\" in archive\n", - outer_member); goto error5; } @@ -130,12 +128,16 @@ _opkg_opk_main_read_control(struct opkg_opk_ustar *ustar) size_t size; int ret; - opkg_opk_ustar_seek(ustar, "control"); + if (opkg_opk_ustar_seek(ustar, "control") != OPKG_OPK_OK) { + fputs("Error: Failed to find control file\n", stderr); + return OPKG_OPK_ERROR; + } while ((ret = opkg_opk_ustar_read(ustar, &buffer, &size)) == OPKG_OPK_OK) { fwrite(buffer, 1, size, stdout); } if (ret == OPKG_OPK_ERROR) { + fputs("Error: Failed to read control file\n", stderr); return OPKG_OPK_ERROR; } @@ -152,6 +154,7 @@ _opkg_opk_main_list_members(struct opkg_opk_ustar *ustar) puts(member.name); } if (ret == OPKG_OPK_ERROR) { + fputs("Error: Failed to list data files\n", stderr); return OPKG_OPK_ERROR; } |