diff options
| author | 2024-05-08 15:24:56 +0000 | |
|---|---|---|
| committer | 2024-05-15 10:09:42 +0000 | |
| commit | 851339d472e65126f32b1b71de0956e9d562d13f (patch) | |
| tree | cf144195896c59e4a468755054765636b11bd0cf | |
| parent | b2c80c7fddc922243ece693dc858b4700ab98d73 (diff) | |
Fix android-cloexec-open clang-tidy issues
Bug: 264654008
Test: m tidy-art
Change-Id: Ia98ee200192cd5f7ea1743224531aa4f89eecf87
| -rw-r--r-- | artd/artd.cc | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/artd/artd.cc b/artd/artd.cc index dbc63fa8d0..a09d1365d3 100644 --- a/artd/artd.cc +++ b/artd/artd.cc @@ -445,8 +445,11 @@ Result<File> ExtractEmbeddedProfileToFd(const std::string& dex_path) { // Reopen the memfd with readonly to make SELinux happy when the fd is passed to a child process // who doesn't have write permission. (b/303909581) std::string path = ART_FORMAT("/proc/self/fd/{}", memfd.Fd()); - File memfd_readonly( - open(path.c_str(), O_RDONLY), memfd_name, /*check_usage=*/false, /*read_only_mode=*/true); + // NOLINTNEXTLINE - O_CLOEXEC is omitted on purpose + File memfd_readonly(open(path.c_str(), O_RDONLY), + memfd_name, + /*check_usage=*/false, + /*read_only_mode=*/true); if (!memfd_readonly.IsOpened()) { return ErrnoErrorf("Failed to open file '{}' ('{}')", path, memfd_name); } |