Skip to content

Commit

Permalink
helpers: make shm_open() portable after 8bcccf9 (#6471)
Browse files Browse the repository at this point in the history
  • Loading branch information
jbeich committed Jun 13, 2024
1 parent e6d1053 commit 4842eb8
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/helpers/MiscFunctions.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 4842eb8

Please sign in to comment.