Skip to content
This repository has been archived by the owner on Jul 23, 2024. It is now read-only.

Commit

Permalink
fix: compilation
Browse files Browse the repository at this point in the history
  • Loading branch information
llenotre committed Jul 21, 2024
1 parent d24d870 commit 0ee1583
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 8 deletions.
3 changes: 1 addition & 2 deletions src/boot.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!");
}
12 changes: 6 additions & 6 deletions src/filesystem.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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!")?;
Expand Down Expand Up @@ -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))?;
Expand Down

0 comments on commit 0ee1583

Please sign in to comment.