From 34b2d80ed29b6d914429d95ed1229cec03307172 Mon Sep 17 00:00:00 2001 From: Patrick McDermott Date: Sun, 07 May 2023 04:48:47 -0400 Subject: gzip: Write compressed output to file directly --- (limited to 'src/opk') 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); -- cgit v0.9.1