From b1c6e052173fcaaf6e29df6969bfc8faf58ef345 Mon Sep 17 00:00:00 2001 From: Dees Troy Date: Mon, 7 Apr 2014 18:01:41 +0000 Subject: Only split archives when split_archives is set In some cases, statfs used on partitions like /system does not report a size that would trigger a split archive, but using stat on the individual files shows a larger size that statfs that would trigger a split. This patch prevents us from trying to split an archive unless we explicitly decided to split in advance. Change-Id: I67f5cd343f12333e1189100cf0ec1c20c15b7cc2 --- twrpTar.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/twrpTar.cpp b/twrpTar.cpp index 08f482168..f6282e73b 100644 --- a/twrpTar.cpp +++ b/twrpTar.cpp @@ -558,7 +558,7 @@ int twrpTar::tarList(std::vector *TarList, unsigned thread_id) { strcpy(buf, TarList->at(i).fn.c_str()); lstat(buf, &st); if (S_ISREG(st.st_mode)) { // item is a regular file - if (Archive_Current_Size + (unsigned long long)(st.st_size) > MAX_ARCHIVE_SIZE) { + if (split_archives && Archive_Current_Size + (unsigned long long)(st.st_size) > MAX_ARCHIVE_SIZE) { if (closeTar() != 0) { LOGERR("Error closing '%s' on thread %i\n", tarfn.c_str(), thread_id); return -3; -- cgit v1.2.3