Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fsevent: return error on canonicalize failure #369

Merged
merged 1 commit into from Nov 22, 2021
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/fsevent.rs
Expand Up @@ -347,6 +347,7 @@ impl FsEventWatcher {
if !path.exists() {
return Err(Error::path_not_found().add_path(path.into()));
}
let canonical_path = path.to_path_buf().canonicalize()?;
0xpr03 marked this conversation as resolved.
Show resolved Hide resolved
let str_path = path.to_str().unwrap();
unsafe {
let mut err: cf::CFErrorRef = ptr::null_mut();
Expand All @@ -361,7 +362,7 @@ impl FsEventWatcher {
cf::CFRelease(cf_path);
}
self.recursive_info.insert(
path.to_path_buf().canonicalize().unwrap(),
canonical_path,
recursive_mode.is_recursive(),
);
Ok(())
Expand Down