diff --git a/backup-daemon/customizesystemrestoreproxy.cpp b/backup-daemon/customizesystemrestoreproxy.cpp index 3ab22a1..e595ebf 100755 --- a/backup-daemon/customizesystemrestoreproxy.cpp +++ b/backup-daemon/customizesystemrestoreproxy.cpp @@ -291,6 +291,7 @@ void CustomizeSystemRestoreProxy::restoreSystem() Utils::writeBackupLog(time + "," + m_curUuid + "," + QString::number(m_backupWrapper.m_type) + ",,,," + m_backupPoint.m_backupName); Utils::updateSyncFile(); + Utils::wait(2); QString fileIfSync = Utils::getSysRootPath() + FILE_IF_SYNC; fileIfSync.replace("//", "/"); QFileInfo file(fileIfSync); diff --git a/backup-daemon/systemrestoreproxy.cpp b/backup-daemon/systemrestoreproxy.cpp index 243efbc..77e52bb 100755 --- a/backup-daemon/systemrestoreproxy.cpp +++ b/backup-daemon/systemrestoreproxy.cpp @@ -353,6 +353,7 @@ void SystemRestoreProxy::restoreSystem() Utils::writeBackupLog(time + "," + m_curUuid + "," + QString::number(m_backupWrapper.m_type) + ",,,," + m_backupPoint.m_backupName); Utils::updateSyncFile(); + Utils::wait(2); QString fileIfSync = Utils::getSysRootPath() + FILE_IF_SYNC; fileIfSync.replace("//", "/"); QFileInfo file(fileIfSync); diff --git a/backup-daemon/udisksystemrestoreproxy.cpp b/backup-daemon/udisksystemrestoreproxy.cpp index c5c7717..ef86e64 100755 --- a/backup-daemon/udisksystemrestoreproxy.cpp +++ b/backup-daemon/udisksystemrestoreproxy.cpp @@ -406,6 +406,7 @@ void UDiskSystemRestoreProxy::restoreSystem() Utils::writeBackupLog(time + "," + m_curUuid + "," + QString::number(m_backupWrapper.m_type) + ",,,," + m_backupPoint.m_backupName); Utils::updateSyncFile(); + Utils::wait(2); QString fileIfSync = Utils::getSysRootPath() + FILE_IF_SYNC; fileIfSync.replace("//", "/"); QFileInfo file(fileIfSync); diff --git a/common/utils.cpp b/common/utils.cpp index 16aa53e..82f54ff 100755 --- a/common/utils.cpp +++ b/common/utils.cpp @@ -1279,6 +1279,8 @@ bool Utils::updateSyncFile() QTextStream out(&file); out << "sync" << END_LINE; + out.flush(); + file.flush(); file.close(); return true;