mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-07 01:06:45 +08:00
posix shm open 失败时如果文件不存在打印log
This commit is contained in:
parent
d69093462a
commit
5c36b1264f
@ -72,7 +72,8 @@ id_t acquire(char const * name, std::size_t size, unsigned mode) {
|
|||||||
S_IRGRP | S_IWGRP |
|
S_IRGRP | S_IWGRP |
|
||||||
S_IROTH | S_IWOTH);
|
S_IROTH | S_IWOTH);
|
||||||
if (fd == -1) {
|
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());
|
ipc::error("fail shm_open[%d]: %s\n", errno, op_name.c_str());
|
||||||
}
|
}
|
||||||
return nullptr;
|
return nullptr;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user