am 45d5d1e5: Merge "Open dictionary files always using O_RDONLY."
* commit '45d5d1e589771b68c4bc635e81b184bc52d65d36': Open dictionary files always using O_RDONLY.main
commit
a72b2359cc
|
@ -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…
Reference in New Issue