Merge changes I51628abe,I412d62b7 am: 9e84b3166f

Original change: https://android-review.googlesource.com/c/platform/system/core/+/1358184

Change-Id: Ia7b7e643c2326fb49ad0966dd1b69339650b6801
This commit is contained in:
Treehugger Robot 2020-07-08 21:38:13 +00:00 committed by Automerger Merge Worker
commit 8f713c56bb

View file

@ -1846,7 +1846,7 @@ auto SnapshotManager::OpenFile(const std::string& file, int lock_flags)
PLOG(ERROR) << "Open failed: " << file;
return nullptr;
}
if (lock_flags != 0 && flock(fd, lock_flags) < 0) {
if (lock_flags != 0 && TEMP_FAILURE_RETRY(flock(fd, lock_flags)) < 0) {
PLOG(ERROR) << "Acquire flock failed: " << file;
return nullptr;
}
@ -1857,7 +1857,7 @@ auto SnapshotManager::OpenFile(const std::string& file, int lock_flags)
}
SnapshotManager::LockedFile::~LockedFile() {
if (flock(fd_, LOCK_UN) < 0) {
if (TEMP_FAILURE_RETRY(flock(fd_, LOCK_UN)) < 0) {
PLOG(ERROR) << "Failed to unlock file: " << path_;
}
}