Require UTF-8 for context name
This commit is contained in:
+5
-8
@@ -82,8 +82,7 @@ pub fn syscall(a: usize, b: usize, c: usize, d: usize, e: usize, f: usize, bp: u
|
||||
let contexts = crate::context::contexts();
|
||||
let current = contexts.current().unwrap();
|
||||
let current = current.read();
|
||||
let name = current.name.read();
|
||||
println!("{:?} using deprecated fmap(...) call", core::str::from_utf8(&name));
|
||||
println!("{:?} using deprecated fmap(...) call", *current.name.read());
|
||||
}
|
||||
file_op(a, fd, c, d)
|
||||
},
|
||||
@@ -92,8 +91,7 @@ pub fn syscall(a: usize, b: usize, c: usize, d: usize, e: usize, f: usize, bp: u
|
||||
let contexts = crate::context::contexts();
|
||||
let current = contexts.current().unwrap();
|
||||
let current = current.read();
|
||||
let name = current.name.read();
|
||||
println!("{:?} using deprecated funmap(...) call", core::str::from_utf8(&name));
|
||||
println!("{:?} using deprecated funmap(...) call", *current.name.read());
|
||||
}
|
||||
funmap_old(b)
|
||||
},
|
||||
@@ -208,8 +206,7 @@ pub fn syscall(a: usize, b: usize, c: usize, d: usize, e: usize, f: usize, bp: u
|
||||
let contexts = crate::context::contexts();
|
||||
if let Some(context_lock) = contexts.current() {
|
||||
let context = context_lock.read();
|
||||
let name_raw = context.name.read();
|
||||
let name = unsafe { core::str::from_utf8_unchecked(&name_raw) };
|
||||
let name = context.name.read();
|
||||
if name.contains("redoxfs") {
|
||||
if a == SYS_CLOCK_GETTIME || a == SYS_YIELD {
|
||||
false
|
||||
@@ -230,7 +227,7 @@ pub fn syscall(a: usize, b: usize, c: usize, d: usize, e: usize, f: usize, bp: u
|
||||
let contexts = crate::context::contexts();
|
||||
if let Some(context_lock) = contexts.current() {
|
||||
let context = context_lock.read();
|
||||
print!("{} ({}): ", unsafe { core::str::from_utf8_unchecked(&context.name.read()) }, context.id.into());
|
||||
print!("{} ({}): ", *context.name.read(), context.id.into());
|
||||
}
|
||||
|
||||
println!("{}", debug::format_call(a, b, c, d, e, f));
|
||||
@@ -265,7 +262,7 @@ pub fn syscall(a: usize, b: usize, c: usize, d: usize, e: usize, f: usize, bp: u
|
||||
let contexts = crate::context::contexts();
|
||||
if let Some(context_lock) = contexts.current() {
|
||||
let context = context_lock.read();
|
||||
print!("{} ({}): ", unsafe { core::str::from_utf8_unchecked(&context.name.read()) }, context.id.into());
|
||||
print!("{} ({}): ", *context.name.read(), context.id.into());
|
||||
}
|
||||
|
||||
print!("{} = ", debug::format_call(a, b, c, d, e, f));
|
||||
|
||||
Reference in New Issue
Block a user