summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2016-08-12 16:47:37 (GMT)
committerJunio C Hamano <gitster@pobox.com>2016-08-12 16:47:37 (GMT)
commit57734b4e88c4d61329c74f5f4fb042f7de622966 (patch)
tree88f9e0ea01da7a39279a8985283fc84858e269f7
parent6d4960ac7d360744fe5bac39cb90697d81128565 (diff)
parent560b0e8f52a734434fecb65647d790913740617f (diff)
downloadgit-57734b4e88c4d61329c74f5f4fb042f7de622966.zip
git-57734b4e88c4d61329c74f5f4fb042f7de622966.tar.gz
git-57734b4e88c4d61329c74f5f4fb042f7de622966.tar.bz2
Merge branch 'jk/big-and-future-archive-tar'
A small code clean-up. * jk/big-and-future-archive-tar: archive-tar: make write_extended_header() void
-rw-r--r--archive-tar.c15
1 files changed, 5 insertions, 10 deletions
diff --git a/archive-tar.c b/archive-tar.c
index 5568240..380e3ae 100644
--- a/archive-tar.c
+++ b/archive-tar.c
@@ -213,9 +213,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;
@@ -226,7 +226,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,
@@ -305,12 +304,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));