Merge AOSP android-9.0.0_r3

Fix conflicts and make it build in 5.1, 6.0, 7.1, 8.1, and 9.0

Change-Id: Ida0a64c29ff27d339b7f42a18d820930964ac6e4
diff --git a/libtar/append.c b/libtar/append.c
index 66e3aa1..8f09de2 100644
--- a/libtar/append.c
+++ b/libtar/append.c
@@ -416,8 +416,7 @@
 tar_append_buffer(TAR *t, void *buf, size_t len)
 {
 	char block[T_BLOCKSIZE];
-	int filefd;
-	int i, j;
+	int i;
 	size_t size = len;
 
 	for (i = size; i > T_BLOCKSIZE; i -= T_BLOCKSIZE)