mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 08:46:45 +08:00
posix shm open 失败时如果文件不存在打印log #2 修改逻辑错误
This commit is contained in:
parent
d69093462a
commit
06d4aec320
@ -72,7 +72,8 @@ id_t acquire(char const * name, std::size_t size, unsigned mode) {
|
||||
S_IRGRP | S_IWGRP |
|
||||
S_IROTH | S_IWOTH);
|
||||
if (fd == -1) {
|
||||
if (open != mode) {
|
||||
// only open shm not log error when file not exist
|
||||
if (open != mode || ENOENT != errno) {
|
||||
ipc::error("fail shm_open[%d]: %s\n", errno, op_name.c_str());
|
||||
}
|
||||
return nullptr;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user