From 140013f27a6c17be4b139786ca1b43012ecc44c3 Mon Sep 17 00:00:00 2001 From: Augustin Cavalier Date: Wed, 7 Dec 2022 17:57:40 -0500 Subject: [PATCH] libroot: Fix open flags in shm_open. We need O_CLOEXEC here, not FD_CLOEXEC (which is equal to 0x1, which in openflags is O_WRONLY and thus leads to the conflicts caught by the previous commit.) Fixes haikuports/haikuports#7524. (cherry picked from commit 59e09f7bebcb8fa9d4ed82f501e6516c3d67d65b) Change-Id: I5751822ac48ae7a865755494da241e4bfd34c45f Reviewed-on: https://review.haiku-os.org/c/haiku/+/5853 Reviewed-by: waddlesplash --- src/system/libroot/posix/sys/mman.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/system/libroot/posix/sys/mman.cpp b/src/system/libroot/posix/sys/mman.cpp index 0c5eb2fba4..d194e40f97 100644 --- a/src/system/libroot/posix/sys/mman.cpp +++ b/src/system/libroot/posix/sys/mman.cpp @@ -216,7 +216,7 @@ shm_open(const char* name, int openMode, mode_t permissions) if (error != B_OK) RETURN_AND_SET_ERRNO(error); - return open(path, openMode | FD_CLOEXEC, permissions); + return open(path, openMode | O_CLOEXEC, permissions); }