Skip to content

Commit

Permalink
throw an exception only on Android if File::unlock has failed
Browse files Browse the repository at this point in the history
  • Loading branch information
nicola-cab committed Aug 24, 2023
1 parent 060c0a3 commit 07c524d
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/realm/util/file.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1098,6 +1098,11 @@ static void _unlock(int m_fd)
do {
r = flock(m_fd, LOCK_UN);
} while (r != 0 && errno == EINTR);
#if REALM_ANDROID
if (r && errno) {
throw RuntimeError("File::unlock() has failed, this is likely due to some limitation in the OS file system.")
}
#endif
REALM_ASSERT_RELEASE_EX(r == 0 && "File::unlock()", r, errno);
}
#endif
Expand Down

0 comments on commit 07c524d

Please sign in to comment.