Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
diqiu50 committed Jan 24, 2025
1 parent 2940167 commit 23fc785
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions clients/filesystem-fuse/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ use tokio::signal::unix::{signal, SignalKind};

fn init_work_dirs(config: &AppConfig, mount_point: &str) -> io::Result<()> {
let data_dir_name = Path::new(&config.fuse.data_dir).to_path_buf();
let data_dir_name = data_dir_name.canonicalize()?;
if !data_dir_name.exists() {
Err(io::Error::new(
io::ErrorKind::NotFound,
Expand Down Expand Up @@ -183,6 +184,16 @@ fn main() -> Result<(), i32> {
};
let app_config = app_config.unwrap();

let mount_point = {
let path = Path::new(&mount_point).canonicalize();
if let Err(e) = path {
error!("Failed to resolve mount point: {:?}", e);
return Err(-1);
};
let path = path.unwrap();
path.to_string_lossy().to_string()
};

let result = init_work_dirs(&app_config, &mount_point);
if let Err(e) = result {
error!("Failed to initialize working directories: {:?}", e);
Expand Down

0 comments on commit 23fc785

Please sign in to comment.