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

Fix build on FreeBSD #399

Merged
merged 2 commits into from Apr 16, 2022
Merged
Show file tree
Hide file tree
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
4 changes: 4 additions & 0 deletions src/kqueue.rs
Expand Up @@ -263,6 +263,10 @@ impl EventLoop {
remove_watches.push(path.clone());
Ok(Event::new(EventKind::Remove(RemoveKind::Any)).add_path(path))
}

// On different BSD variants, different extra events may be present
#[allow(unreachable_patterns)]
_ => Ok(Event::new(EventKind::Other)),
};
self.event_handler.handle_event(event);
}
Expand Down
11 changes: 10 additions & 1 deletion src/lib.rs
Expand Up @@ -111,6 +111,9 @@ pub use crate::fsevent::FsEventWatcher;
pub use crate::inotify::INotifyWatcher;
#[cfg(any(
target_os = "freebsd",
target_os = "openbsd",
target_os = "netbsd",
target_os = "dragonflybsd",
all(target_os = "macos", feature = "macos_kqueue")
))]
pub use crate::kqueue::KqueueWatcher;
Expand Down Expand Up @@ -269,6 +272,9 @@ pub type RecommendedWatcher = ReadDirectoryChangesWatcher;
/// The recommended `Watcher` implementation for the current platform
#[cfg(any(
target_os = "freebsd",
target_os = "openbsd",
target_os = "netbsd",
target_os = "dragonflybsd",
all(target_os = "macos", feature = "macos_kqueue")
))]
pub type RecommendedWatcher = KqueueWatcher;
Expand All @@ -277,7 +283,10 @@ pub type RecommendedWatcher = KqueueWatcher;
target_os = "linux",
target_os = "macos",
target_os = "windows",
target_os = "freebsd"
target_os = "freebsd",
target_os = "openbsd",
target_os = "netbsd",
target_os = "dragonflybsd"
)))]
pub type RecommendedWatcher = PollWatcher;

Expand Down