summaryrefslogtreecommitdiff
path: root/archive-tar.c
diff options
context:
space:
mode:
authorRené Scharfe <l.s.r@web.de>2016-08-06 16:35:38 +0200
committerJunio C Hamano <gitster@pobox.com>2016-08-06 10:31:51 -0700
commit560b0e8f52a734434fecb65647d790913740617f (patch)
tree9a28e32f815b9377d0aaeb4369f255d2c6f353fc /archive-tar.c
parent5caeeb83bcb88622db739fe27ee8bfc64e9cbf21 (diff)
downloadgit-560b0e8f52a734434fecb65647d790913740617f.tar.gz
archive-tar: make write_extended_header() voidjk/big-and-future-archive-tar
The function write_extended_header() only ever returns 0. Simplify it and its caller by dropping its return value, like we did with write_global_extended_header() earlier. Signed-off-by: Rene Scharfe <l.s.r@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'archive-tar.c')
-rw-r--r--archive-tar.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/archive-tar.c b/archive-tar.c
index 7ea4e90814..ce031f44ba 100644
--- a/archive-tar.c
+++ b/archive-tar.c
@@ -208,9 +208,9 @@ static void prepare_header(struct archiver_args *args,
xsnprintf(header->chksum, sizeof(header->chksum), "%07o", ustar_header_chksum(header));
}
-static int write_extended_header(struct archiver_args *args,
- const unsigned char *sha1,
- const void *buffer, unsigned long size)
+static void write_extended_header(struct archiver_args *args,
+ const unsigned char *sha1,
+ const void *buffer, unsigned long size)
{
struct ustar_header header;
unsigned int mode;
@@ -221,7 +221,6 @@ static int write_extended_header(struct archiver_args *args,
prepare_header(args, &header, mode, size);
write_blocked(&header, sizeof(header));
write_blocked(buffer, size);
- return 0;
}
static int write_tar_entry(struct archiver_args *args,
@@ -300,12 +299,8 @@ static int write_tar_entry(struct archiver_args *args,
prepare_header(args, &header, mode, size_in_header);
if (ext_header.len > 0) {
- err = write_extended_header(args, sha1, ext_header.buf,
- ext_header.len);
- if (err) {
- free(buffer);
- return err;
- }
+ write_extended_header(args, sha1, ext_header.buf,
+ ext_header.len);
}
strbuf_release(&ext_header);
write_blocked(&header, sizeof(header));