mirror of
https://gitlab.futo.org/keyboard/latinime.git
synced 2024-09-28 14:54:30 +01:00
Open dictionary files always using O_RDONLY.
We never directly write to opened and mmapped files. Bug: 11391620 Change-Id: Ic52fbe6018b8b3c1b6ca687461f29185809217c2
This commit is contained in:
parent
c481d0556f
commit
2271c23dc6
@ -30,8 +30,7 @@ namespace latinime {
|
|||||||
/* static */ MmappedBuffer::MmappedBufferPtr MmappedBuffer::openBuffer(
|
/* static */ MmappedBuffer::MmappedBufferPtr MmappedBuffer::openBuffer(
|
||||||
const char *const path, const int bufferOffset, const int bufferSize,
|
const char *const path, const int bufferOffset, const int bufferSize,
|
||||||
const bool isUpdatable) {
|
const bool isUpdatable) {
|
||||||
const int openMode = isUpdatable ? O_RDWR : O_RDONLY;
|
const int mmapFd = open(path, O_RDONLY);
|
||||||
const int mmapFd = open(path, openMode);
|
|
||||||
if (mmapFd < 0) {
|
if (mmapFd < 0) {
|
||||||
AKLOGE("DICT: Can't open the source. path=%s errno=%d", path, errno);
|
AKLOGE("DICT: Can't open the source. path=%s errno=%d", path, errno);
|
||||||
return MmappedBufferPtr(0);
|
return MmappedBufferPtr(0);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user