mirror of
https://github.com/mutouyun/cpp-ipc.git
synced 2025-12-06 08:46:45 +08:00
Try to fix permission issues under linux
This commit is contained in:
parent
84bb801b6e
commit
2673453e66
@ -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;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user