Skip to content
Snippets Groups Projects
Verified Commit 47048102 authored by Jeremy Soller's avatar Jeremy Soller
Browse files

Fix typo in ContextList

parent b8e47f6b
No related branches found
No related tags found
No related merge requests found
......@@ -31,7 +31,7 @@ impl ContextList {
}
/// Get an iterator of all parents
pub fn anchestors(&'_ self, id: ContextId) -> impl Iterator<Item = (ContextId, &Arc<RwLock<Context>>)> + '_ {
pub fn ancestors(&'_ self, id: ContextId) -> impl Iterator<Item = (ContextId, &Arc<RwLock<Context>>)> + '_ {
iter::successors(self.get(id).map(|context| (id, context)), move |(_id, context)| {
let context = context.read();
let id = context.ppid;
......@@ -47,6 +47,7 @@ impl ContextList {
pub fn iter(&self) -> ::alloc::collections::btree_map::Iter<ContextId, Arc<RwLock<Context>>> {
self.map.iter()
}
pub fn range(&self, range: impl core::ops::RangeBounds<ContextId>) -> ::alloc::collections::btree_map::Range<'_, ContextId, Arc<RwLock<Context>>> {
self.map.range(range)
}
......
......@@ -258,7 +258,7 @@ impl Scheme for ProcScheme {
// Is it a subprocess of us? In the future, a capability could
// bypass this check.
match contexts.anchestors(target.ppid).find(|&(id, _context)| id == current.id) {
match contexts.ancestors(target.ppid).find(|&(id, _context)| id == current.id) {
Some((id, context)) => {
// Paranoid sanity check, as ptrace security holes
// wouldn't be fun
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment