Skip to content

Commit

Permalink
[eclipse-iceoryx#51] Only create shm state file when O_CREAT is set
Browse files Browse the repository at this point in the history
  • Loading branch information
elfenpiff committed Dec 21, 2023
1 parent 439f39f commit 5432c43
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 0 deletions.
1 change: 1 addition & 0 deletions .cirrus.yml
Original file line number Diff line number Diff line change
Expand Up @@ -283,4 +283,5 @@ macos_aarch64_stable_debug_task:
-p iceoryx2-bb-testing
-p iceoryx2-bb-threadsafe
-p iceoryx2-bb-trait-tests
-p iceoryx2-cal
--lib --bins --tests --no-fail-fast
4 changes: 4 additions & 0 deletions iceoryx2-pal/posix/src/macos/mman.rs
Original file line number Diff line number Diff line change
Expand Up @@ -141,6 +141,10 @@ pub unsafe fn shm_open(name: *const char, oflag: int, mode: mode_t) -> int {
let real_name = match real_name {
Some(name) => name,
None => {
if oflag & O_CREAT == 0 {
Errno::set(Errno::ENOENT);
return -1;
}
let real_name = generate_real_shm_name();
if !write_real_shm_name(name, &real_name) {
return -1;
Expand Down

0 comments on commit 5432c43

Please sign in to comment.