diff options
author | 2013-10-25 17:35:37 -0700 | |
---|---|---|
committer | 2013-10-25 17:35:37 -0700 | |
commit | 2271c23dc68c15fc9a1f8db7179beac1f5d0c6df (patch) | |
tree | 3e306870e3d6fea559788ee4e4fd1454bfca79bd | |
parent | c481d0556fe62cdaaf6d6d8cf037a33ce665f44c (diff) | |
download | latinime-2271c23dc68c15fc9a1f8db7179beac1f5d0c6df.tar.gz latinime-2271c23dc68c15fc9a1f8db7179beac1f5d0c6df.tar.xz latinime-2271c23dc68c15fc9a1f8db7179beac1f5d0c6df.zip |
Open dictionary files always using O_RDONLY.
We never directly write to opened and mmapped files.
Bug: 11391620
Change-Id: Ic52fbe6018b8b3c1b6ca687461f29185809217c2
-rw-r--r-- | native/jni/src/suggest/policyimpl/dictionary/utils/mmapped_buffer.cpp | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/native/jni/src/suggest/policyimpl/dictionary/utils/mmapped_buffer.cpp b/native/jni/src/suggest/policyimpl/dictionary/utils/mmapped_buffer.cpp index 71f863290..28af97351 100644 --- a/native/jni/src/suggest/policyimpl/dictionary/utils/mmapped_buffer.cpp +++ b/native/jni/src/suggest/policyimpl/dictionary/utils/mmapped_buffer.cpp @@ -30,8 +30,7 @@ namespace latinime { /* static */ MmappedBuffer::MmappedBufferPtr MmappedBuffer::openBuffer( const char *const path, const int bufferOffset, const int bufferSize, const bool isUpdatable) { - const int openMode = isUpdatable ? O_RDWR : O_RDONLY; - const int mmapFd = open(path, openMode); + const int mmapFd = open(path, O_RDONLY); if (mmapFd < 0) { AKLOGE("DICT: Can't open the source. path=%s errno=%d", path, errno); return MmappedBufferPtr(0); |