diff --git a/src/boot.rs b/src/boot.rs index 110d4a2..912f51d 100644 --- a/src/boot.rs +++ b/src/boot.rs @@ -11,6 +11,5 @@ pub fn main() { unsafe { libc::syscall(libc::SYS_reboot, 0xde145e83u32, 0x40367d6eu32, cmd, 0); } - // Loop in case shutdown failed for some reason - loop {} + panic!("Shutdown failed!"); } diff --git a/src/filesystem.rs b/src/filesystem.rs index bc517bf..c763273 100644 --- a/src/filesystem.rs +++ b/src/filesystem.rs @@ -14,12 +14,12 @@ use std::path::Path; pub fn basic() -> TestResult { log!("File creation"); - const PATH: &Path = Path::new("test"); + let path = Path::new("test"); let mut file = OpenOptions::new() .create_new(true) .read(true) .write(true) - .open(PATH)?; + .open(path)?; log!("File write"); let len = file.write(b"hello world!")?; @@ -58,10 +58,10 @@ pub fn basic() -> TestResult { // TODO change access/modification times log!("File remove"); - test_assert!(PATH.exists()); - fs::remove_file(PATH)?; - test_assert!(!PATH.exists()); - test_assert!(matches!(fs::remove_file(PATH), Err(e) if e.kind() == io::ErrorKind::NotFound)); + test_assert!(path.exists()); + fs::remove_file(path)?; + test_assert!(!path.exists()); + test_assert!(matches!(fs::remove_file(path), Err(e) if e.kind() == io::ErrorKind::NotFound)); log!("File remove defer"); let off = file.seek(SeekFrom::End(0))?;