Skip to content

Commit 06d4aec

Browse files
author
Aengus.Jiang
committed
posix shm open 失败时如果文件不存在打印log #2 修改逻辑错误
1 parent d690934 commit 06d4aec

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libipc/platform/posix/shm_posix.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,8 @@ id_t acquire(char const * name, std::size_t size, unsigned mode) {
7272
S_IRGRP | S_IWGRP |
7373
S_IROTH | S_IWOTH);
7474
if (fd == -1) {
75-
if (open != mode) {
75+
// only open shm not log error when file not exist
76+
if (open != mode || ENOENT != errno) {
7677
ipc::error("fail shm_open[%d]: %s\n", errno, op_name.c_str());
7778
}
7879
return nullptr;

0 commit comments

Comments
 (0)