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

Merge branch 'aj-chdir-initfs-message' into 'master'

Add more descriptive error message for when initfs chdir fails

See merge request redox-os/kernel!150
parents 6ba38500 dc6132dc
No related branches found
No related tags found
1 merge request!150Add more descriptive error message for when initfs chdir fails
...@@ -170,7 +170,12 @@ pub extern fn userspace_init() { ...@@ -170,7 +170,12 @@ pub extern fn userspace_init() {
let path = b"initfs:/bin/init"; let path = b"initfs:/bin/init";
let env = unsafe { INIT_ENV }; let env = unsafe { INIT_ENV };
assert_eq!(syscall::chdir(b"initfs:"), Ok(0)); if let Err(err) = syscall::chdir(b"initfs:") {
info!("Failed to enter initfs ({}).", err);
info!("Perhaps the kernel was compiled with an incorrect INITFS_FOLDER \
environment variable value?");
panic!("Unexpected error while trying to enter initfs:.");
}
assert_eq!(syscall::open(b"debug:", syscall::flag::O_RDONLY).map(FileHandle::into), Ok(0)); assert_eq!(syscall::open(b"debug:", syscall::flag::O_RDONLY).map(FileHandle::into), Ok(0));
assert_eq!(syscall::open(b"debug:", syscall::flag::O_WRONLY).map(FileHandle::into), Ok(1)); assert_eq!(syscall::open(b"debug:", syscall::flag::O_WRONLY).map(FileHandle::into), Ok(1));
......
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