posix shm open 失败时如果文件不存在打印log #2 修改逻辑错误

This commit is contained in:
Aengus.Jiang 2025-03-07 12:33:42 +08:00
parent d69093462a
commit 06d4aec320

View File

@ -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;