mirror of
https://github.com/hyprwm/Hyprland
synced 2024-11-26 00:25:59 +01:00
helpers: make shm_open() portable after 8bcccf9f0f
(#6471)
https://pubs.opengroup.org/onlinepubs/9699919799/functions/shm_open.html https://man.freebsd.org/shm_open/2 https://www.man7.org/linux/man-pages/man3/shm_open.3.html
This commit is contained in:
parent
e6d10539af
commit
4842eb83b4
1 changed files with 2 additions and 1 deletions
|
@ -814,7 +814,8 @@ bool envEnabled(const std::string& env) {
|
|||
}
|
||||
|
||||
std::pair<int, std::string> openExclusiveShm() {
|
||||
std::string name = g_pTokenManager->getRandomUUID();
|
||||
// Only absolute paths can be shared across different shm_open() calls
|
||||
std::string name = "/" + g_pTokenManager->getRandomUUID();
|
||||
|
||||
for (size_t i = 0; i < 69; ++i) {
|
||||
int fd = shm_open(name.c_str(), O_RDWR | O_CREAT | O_EXCL, 0600);
|
||||
|
|
Loading…
Reference in a new issue