Consolidate for_each implementation into Rust

This commit is contained in:
topjohnwu
2025-08-24 15:13:56 -07:00
committed by John Wu
parent 78f5cd55c7
commit e91fc75d86
12 changed files with 103 additions and 103 deletions

View File

@@ -300,7 +300,8 @@ static bool proc_is_restricted(pid_t pid) {
auto bnd = "CapBnd:"sv;
uint32_t data[_LINUX_CAPABILITY_U32S_3] = {};
ssprintf(buf, sizeof(buf), "/proc/%d/status", pid);
file_readline(buf, [&](string_view line) -> bool {
owned_fd status_fd = xopen(buf, O_RDONLY | O_CLOEXEC);
file_readline(status_fd, [&](string_view line) -> bool {
if (line.starts_with(bnd)) {
auto p = line.begin();
advance(p, bnd.size());