use Display for displaying IoErrors
This commit is contained in:
parent
7e0b126f42
commit
a04117f955
|
@ -49,7 +49,7 @@ impl Stack {
|
||||||
let stack = unsafe {
|
let stack = unsafe {
|
||||||
let ptr = match sys::map_stack(size) {
|
let ptr = match sys::map_stack(size) {
|
||||||
None => {
|
None => {
|
||||||
panic!("mmap for stack of size {} failed: {:?}",
|
panic!("mmap for stack of size {} failed: {}",
|
||||||
len, IoError::last_os_error())
|
len, IoError::last_os_error())
|
||||||
}
|
}
|
||||||
Some(ptr) => ptr
|
Some(ptr) => ptr
|
||||||
|
@ -64,7 +64,7 @@ impl Stack {
|
||||||
|
|
||||||
unsafe {
|
unsafe {
|
||||||
if !sys::protect_stack(stack.ptr) {
|
if !sys::protect_stack(stack.ptr) {
|
||||||
panic!("mprotect for guard page of stack {:p} failed: {:?}",
|
panic!("mprotect for guard page of stack {:p} failed: {}",
|
||||||
stack.ptr, IoError::last_os_error());
|
stack.ptr, IoError::last_os_error());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -78,7 +78,7 @@ impl Drop for Stack {
|
||||||
unsafe {
|
unsafe {
|
||||||
valgrind::stack_deregister(self.valgrind_id);
|
valgrind::stack_deregister(self.valgrind_id);
|
||||||
if !sys::unmap_stack(self.ptr, self.len) {
|
if !sys::unmap_stack(self.ptr, self.len) {
|
||||||
panic!("munmap for stack {:p} of size {} failed: {:?}",
|
panic!("munmap for stack {:p} of size {} failed: {}",
|
||||||
self.ptr, self.len, IoError::last_os_error())
|
self.ptr, self.len, IoError::last_os_error())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue