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

Make watcher's path absolute for notify's MacOS fsevent implementation #155

Merged
merged 1 commit into from
Apr 15, 2022
Merged

Make watcher's path absolute for notify's MacOS fsevent implementation #155

merged 1 commit into from
Apr 15, 2022

Conversation

voidbuf
Copy link
Contributor

@voidbuf voidbuf commented Apr 13, 2022

This is a proposed fix for #154
I have chosen to replicate the logic present in notify's inotify implementation. In the notify crate, these checks make it so that there is no error when presenting a watcher with an empty path ("") on Linux, but they are missing from MacOS's fsevent implementation, and therefore I propose to always offer the watcher an absolute path.

Another possible solution is to handle the error returned from this call:

watcher.watch(parent_path, RecursiveMode::NonRecursive)?;

using something like

if let Err(e) = watcher.watch(parent_path, RecursiveMode::NonRecursive) {
  // handle...
}

but this means that one could not run rathole on MacOS using this syntax: rathole config.toml

@rapiz1 rapiz1 merged commit 8665e6a into rapiz1:main Apr 15, 2022
@rapiz1
Copy link
Owner

rapiz1 commented Apr 15, 2022

Nice catch. Thanks for your contribution!

cssivision pushed a commit to cssivision/rathole that referenced this pull request Apr 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants