diff --git a/src/realm/util/file.cpp b/src/realm/util/file.cpp index 09c0f99f35b..6148cf5e939 100644 --- a/src/realm/util/file.cpp +++ b/src/realm/util/file.cpp @@ -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