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
This commit is contained in:
Dees Troy
2014-04-07 18:01:41 +00:00
parent 9d72327cfc
commit b1c6e05217
+1 -1
View File
@@ -558,7 +558,7 @@ int twrpTar::tarList(std::vector<TarListStruct> *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;