fix: Always increment active_count in override_at to ensure synchronization

This commit is contained in:
Ibuki.O
2026-07-05 11:18:25 +09:00
parent fef4343580
commit d84be7571f
+2 -4
View File
@@ -1079,7 +1079,7 @@ impl FdTbl {
}
pub fn override_at(&mut self, fd: usize, new_fd: usize) -> Result<usize> {
let existed = self.remove(new_fd).is_ok();
let _ = self.remove(new_fd);
if Self::is_upper(new_fd) {
let handle = Self::strip_tags(new_fd);
@@ -1096,9 +1096,7 @@ impl FdTbl {
)?;
}
if !existed {
self.active_count += 1;
}
self.active_count += 1;
Ok(new_fd)
}
pub fn add_posix(&mut self, entry: usize) -> Result<usize> {