Try to fix permission issues under linux

This commit is contained in:
mutouyun 2024-12-01 21:06:06 +08:00
parent 84bb801b6e
commit 2673453e66

View File

@ -68,7 +68,9 @@ id_t acquire(char const * name, std::size_t size, unsigned mode) {
flag |= O_CREAT;
break;
}
int fd = ::shm_open(op_name.c_str(), flag, 0);
int fd = ::shm_open(op_name.c_str(), flag, S_IRUSR | S_IWUSR |
S_IRGRP | S_IWGRP |
S_IROTH | S_IWOTH);
if (fd == -1) {
ipc::error("fail shm_open[%d]: %s\n", errno, op_name.c_str());
return nullptr;