summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ustar.c13
-rw-r--r--src/ustar.h3
2 files changed, 16 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)
{
diff --git a/src/ustar.h b/src/ustar.h
index 4f6b79b..679f8ae 100644
--- a/src/ustar.h
+++ b/src/ustar.h
@@ -99,6 +99,9 @@ opkg_opk_ustar_get_buffer(struct opkg_opk_ustar *ustar, char **buffer,
int
opkg_opk_ustar_write_data(struct opkg_opk_ustar *ustar, size_t size);
+int
+opkg_opk_ustar_write_trailer(struct opkg_opk_ustar *ustar);
+
/*
* Frees an archive structure.
* Parameters: