Fix problem with not waiting for pigz to exit
In some cases compressed backups would not wait for pigz to finish
leading to backup files that were 0 bytes or MD5 mismatches.
diff --git a/partitionmanager.cpp b/partitionmanager.cpp
index fc76c1a..fb3da5a 100644
--- a/partitionmanager.cpp
+++ b/partitionmanager.cpp
@@ -611,6 +611,8 @@
if ((*subpart)->Can_Be_Backed_Up && (*subpart)->Is_SubPartition && (*subpart)->SubPartition_Of == Part->Mount_Point) {
if (!(*subpart)->Backup(Backup_Folder))
return false;
+ sync();
+ sync();
if (!Make_MD5(generate_md5, Backup_Folder, (*subpart)->Backup_FileName))
return false;
if (Part->Backup_Method == 1) {
diff --git a/twrpTar.cpp b/twrpTar.cpp
index 8bfbecd..59d75d0 100644
--- a/twrpTar.cpp
+++ b/twrpTar.cpp
@@ -1251,7 +1251,7 @@
LOGERR("Unable to close tar archive: '%s'\n", tarfn.c_str());
return -1;
}
- if (Archive_Current_Type > 1) {
+ if (Archive_Current_Type > 0) {
close(fd);
int status;
if (pigz_pid > 0 && TWFunc::Wait_For_Child(pigz_pid, &status, "pigz") != 0)