From 47048102efd9961587ca0c6f83c6d93f729e664c Mon Sep 17 00:00:00 2001 From: Jeremy Soller Date: Tue, 2 Mar 2021 19:57:44 -0700 Subject: [PATCH] Fix typo in ContextList --- src/context/list.rs | 3 ++- src/scheme/proc.rs | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/context/list.rs b/src/context/list.rs index a1a2895..0095e23 100644 --- a/src/context/list.rs +++ b/src/context/list.rs @@ -31,7 +31,7 @@ impl ContextList { } /// Get an iterator of all parents - pub fn anchestors(&'_ self, id: ContextId) -> impl Iterator>)> + '_ { + pub fn ancestors(&'_ self, id: ContextId) -> impl Iterator>)> + '_ { 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>> { self.map.iter() } + pub fn range(&self, range: impl core::ops::RangeBounds) -> ::alloc::collections::btree_map::Range<'_, ContextId, Arc>> { self.map.range(range) } diff --git a/src/scheme/proc.rs b/src/scheme/proc.rs index 124ca0c..ceb628d 100644 --- a/src/scheme/proc.rs +++ b/src/scheme/proc.rs @@ -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