diff options
author | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2023-05-07 04:48:47 (EDT) |
---|---|---|
committer | Patrick McDermott <patrick.mcdermott@libiquity.com> | 2023-05-07 07:14:13 (EDT) |
commit | 34b2d80ed29b6d914429d95ed1229cec03307172 (patch) | |
tree | 03134df15fdc39ebb85fbe159d560f14c388db0d /src/opk | |
parent | e473ff37e0febb0c0dda71d6d277cc833bc9f7a3 (diff) |
gzip: Write compressed output to file directly
Diffstat (limited to 'src/opk')
-rw-r--r-- | src/opk/write.c | 17 |
1 files changed, 1 insertions, 16 deletions
diff --git a/src/opk/write.c b/src/opk/write.c index 5ddd502..2a38f79 100644 --- a/src/opk/write.c +++ b/src/opk/write.c @@ -31,18 +31,6 @@ #include "opk.h" static int -_opkg_opk_opk_write_file(void *user_data, size_t size) -{ - struct opkg_opk_opk *opk = user_data; - - if (fwrite(opk->file_buffer, 1, size, opk->file) == size) { - return OPKG_OPK_OK; - } else { - return OPKG_OPK_ERROR; - } -} - -static int _opkg_opk_opk_source_date_epoch(uint64_t *mtime) { char *env; @@ -87,15 +75,12 @@ opkg_opk_opk_write(struct opkg_opk_opk *opk, const char *file_name) } /* Initialize outer gzip decompressor. */ - opk->outer_gzip = opkg_opk_gzip_init_write(&_opkg_opk_opk_write_file, - opk); + opk->outer_gzip = opkg_opk_gzip_init_write(opk->file); if (opk->outer_gzip == NULL) { fputs(_("Error: Failed to initialize\n"), stderr); ret = OPKG_OPK_ERROR; goto out1; } - opkg_opk_gzip_set_write_buffer(opk->outer_gzip, opk->file_buffer, - sizeof(opk->file_buffer)); /* Initialize outer ustar unarchiver. */ opk->outer_ustar = opkg_opk_ustar_init(opk->outer_gzip); |