Skip to content

Commit

Permalink
mod visibility, code style
Browse files Browse the repository at this point in the history
  • Loading branch information
tompro committed Nov 15, 2023
1 parent 9dbb3cd commit 67137d4
Show file tree
Hide file tree
Showing 5 changed files with 17 additions and 7 deletions.
3 changes: 3 additions & 0 deletions src/kernel/src/fs/dev/console.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,14 @@ use crate::process::VThread;
use crate::ucred::Ucred;
use macros::vpath;
use std::fmt::{Display, Formatter};

/// An implementation of `/dev/console`.
#[derive(Debug)]
pub struct Console {}

impl Console {
pub const PATH: &VPath = vpath!("/dev/console");

pub fn new() -> Self {
Self {}
}
Expand Down
6 changes: 3 additions & 3 deletions src/kernel/src/fs/dev/mod.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
pub mod console;
pub mod dipsw;
pub mod stdout;
pub(super) mod console;
pub(super) mod dipsw;
pub(super) mod stdout;
7 changes: 5 additions & 2 deletions src/kernel/src/fs/item.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
use super::{FsError, VFileOps, VPath, VPathBuf, dev::{dipsw::Dipsw, stdout::Stdout}};
use super::{
dev::{dipsw::Dipsw, stdout::Stdout},
FsError, VFileOps, VPath, VPathBuf,
};
use crate::fs::dev::console::Console;
use std::path::{Path, PathBuf};

Expand Down Expand Up @@ -86,7 +89,7 @@ impl HostFile {
pub enum VDev {
Console,
Dipsw,
Stdout
Stdout,
}

impl VDev {
Expand Down
2 changes: 1 addition & 1 deletion src/kernel/src/fs/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,8 @@ use std::sync::atomic::{AtomicI32, Ordering};
use std::sync::Arc;
use thiserror::Error;

mod file;
mod dev;
mod file;
mod item;
mod path;

Expand Down
6 changes: 5 additions & 1 deletion src/kernel/src/process/file.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,8 @@
use crate::{fs::{VFile, Fd}, syscalls::SysErr, errno::EBADF};
use crate::{
errno::EBADF,
fs::{Fd, VFile},
syscalls::SysErr,
};
use gmtx::{GroupMutex, MutexGroup};
use std::sync::Arc;

Expand Down

0 comments on commit 67137d4

Please sign in to comment.