[compiler-rt] [sanitizer] Fix race condition in GetNamedMappingFd with decorate_pro… (PR #190617)
via llvm-commits
llvm-commits at lists.llvm.org
Mon Apr 6 11:55:17 PDT 2026
github-actions[bot] wrote:
<!--LLVM CODE FORMAT COMMENT: {clang-format}-->
:warning: C/C++ code formatter, clang-format found issues in your code. :warning:
<details>
<summary>
You can test this locally with the following command:
</summary>
``````````bash
git-clang-format --diff origin/main HEAD --extensions cpp -- compiler-rt/lib/sanitizer_common/sanitizer_posix.cpp --diff_from_common_commit
``````````
:warning:
The reproduction instructions above might return results for more than one PR
in a stack if you are using a stacked PR workflow. You can limit the results by
changing `origin/main` to the base branch/commit you want to compare against.
:warning:
</details>
<details>
<summary>
View the diff from clang-format here.
</summary>
``````````diff
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_posix.cpp b/compiler-rt/lib/sanitizer_common/sanitizer_posix.cpp
index 6c9adaff8..04606afb6 100644
--- a/compiler-rt/lib/sanitizer_common/sanitizer_posix.cpp
+++ b/compiler-rt/lib/sanitizer_common/sanitizer_posix.cpp
@@ -375,13 +375,13 @@ int GetNamedMappingFd(const char *name, uptr size, int *flags) {
internal_close(fd);
return -1;
}
-#if !defined(O_CLOEXEC)
+# if !defined(O_CLOEXEC)
res = fcntl(fd, F_SETFD, FD_CLOEXEC);
if (res == -1) {
internal_close(fd);
return -1;
}
-#endif
+# endif
res = internal_unlink(shmname);
if (res == -1) {
internal_close(fd);
``````````
</details>
https://github.com/llvm/llvm-project/pull/190617
More information about the llvm-commits
mailing list