summaryrefslogtreecommitdiffstats
path: root/libtar/extract.c
diff options
context:
space:
mode:
authorEthan Yonker <dees_troy@teamw.in>2014-07-03 22:09:22 +0200
committerEthan Yonker <dees_troy@teamw.in>2014-07-09 15:52:18 +0200
commit1b7a31bd65d4e6bf5e337d6280e3d5319d460bef (patch)
treeebe7d27ea5681d1b3c772a7bc2e80025e94435a6 /libtar/extract.c
parentColor in the console (diff)
downloadandroid_bootable_recovery-1b7a31bd65d4e6bf5e337d6280e3d5319d460bef.tar
android_bootable_recovery-1b7a31bd65d4e6bf5e337d6280e3d5319d460bef.tar.gz
android_bootable_recovery-1b7a31bd65d4e6bf5e337d6280e3d5319d460bef.tar.bz2
android_bootable_recovery-1b7a31bd65d4e6bf5e337d6280e3d5319d460bef.tar.lz
android_bootable_recovery-1b7a31bd65d4e6bf5e337d6280e3d5319d460bef.tar.xz
android_bootable_recovery-1b7a31bd65d4e6bf5e337d6280e3d5319d460bef.tar.zst
android_bootable_recovery-1b7a31bd65d4e6bf5e337d6280e3d5319d460bef.zip
Diffstat (limited to 'libtar/extract.c')
-rw-r--r--libtar/extract.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/libtar/extract.c b/libtar/extract.c
index 4526c98ee..e605aca43 100644
--- a/libtar/extract.c
+++ b/libtar/extract.c
@@ -94,7 +94,7 @@ tar_set_file_perms(TAR *t, char *realname)
/* switchboard */
int
-tar_extract_file(TAR *t, char *realname, char *prefix)
+tar_extract_file(TAR *t, char *realname, char *prefix, const int *progress_fd)
{
int i;
char *lnp;
@@ -141,7 +141,7 @@ tar_extract_file(TAR *t, char *realname, char *prefix)
}
else /* if (TH_ISREG(t)) */ {
printf("reg\n");
- i = tar_extract_regfile(t, realname);
+ i = tar_extract_regfile(t, realname, progress_fd);
}
if (i != 0) {
@@ -189,7 +189,7 @@ tar_extract_file(TAR *t, char *realname, char *prefix)
/* extract regular file */
int
-tar_extract_regfile(TAR *t, char *realname)
+tar_extract_regfile(TAR *t, char *realname, const int *progress_fd)
{
//mode_t mode;
size_t size;
@@ -285,6 +285,11 @@ tar_extract_regfile(TAR *t, char *realname)
printf("### done extracting %s\n", filename);
#endif
+ if (*progress_fd != 0) {
+ unsigned long long file_size = (unsigned long long)(size);
+ write(*progress_fd, &file_size, sizeof(file_size));
+ }
+
return 0;
}