summaryrefslogtreecommitdiffstats
path: root/src/ustar.c
diff options
context:
space:
mode:
authorPatrick McDermott <patrick.mcdermott@libiquity.com>2023-04-30 03:24:14 (EDT)
committer Patrick McDermott <patrick.mcdermott@libiquity.com>2023-04-30 03:37:57 (EDT)
commitd159b5cf03212e9ecb848dd7eef5edc3ba1a7bba (patch)
tree0e2e375be7865329ae6c712f5ab93df282451119 /src/ustar.c
parent6b09c55d892e31a633075279bf9c1446b69d139e (diff)
ustar: Add function to write trailer
Diffstat (limited to 'src/ustar.c')
-rw-r--r--src/ustar.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/ustar.c b/src/ustar.c
index 7fa64e2..e1771c3 100644
--- a/src/ustar.c
+++ b/src/ustar.c
@@ -351,6 +351,19 @@ opkg_opk_ustar_write_data(struct opkg_opk_ustar *ustar, size_t size)
return OPKG_OPK_OK;
}
+int
+opkg_opk_ustar_write_trailer(struct opkg_opk_ustar *ustar)
+{
+ memset(ustar->record, 0, OPKG_OPK_USTAR_RECORD_SIZE);
+ if (opkg_opk_gzip_write(ustar->gzip, ustar->record,
+ OPKG_OPK_USTAR_RECORD_SIZE, 0) != OPKG_OPK_OK ||
+ opkg_opk_gzip_write(ustar->gzip, ustar->record,
+ OPKG_OPK_USTAR_RECORD_SIZE, 0) != OPKG_OPK_OK) {
+ return OPKG_OPK_ERROR;
+ }
+ return OPKG_OPK_OK;
+}
+
void
opkg_opk_ustar_free(struct opkg_opk_ustar *ustar)
{