ifaddrs: read_attr closure returns Option, so .ok() the read_file Result

The read_attr closure is typed -> Option<Vec<u8>> and its callers use
`if let Some(...)`, but it returned read_file(...) directly, which is
Result<Vec<u8>, ()> — E0308. Map it with .ok() (Ok->Some, Err(())->None).
Fixes the relibc compile error that failed the prefix rebuild.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-07-28 08:50:39 +09:00
parent 2f63e0e78c
commit 5852966c33
+1 -1
View File
@@ -381,7 +381,7 @@ fn enumerate_interfaces_redox() -> Result<Vec<InterfaceInfo>, ()> {
} }
path_buf[path_len..path_len + suffix.len()].copy_from_slice(suffix); path_buf[path_len..path_len + suffix.len()].copy_from_slice(suffix);
path_buf[path_len + suffix.len()] = 0; path_buf[path_len + suffix.len()] = 0;
read_file(&path_buf[..need]) read_file(&path_buf[..need]).ok()
}; };
if let Some(flags_bytes) = read_attr(b"flags") { if let Some(flags_bytes) = read_attr(b"flags") {