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

Only check for ENOSPC on inotify_add_watch #330

Merged
merged 1 commit into from Jun 8, 2021
Merged

Conversation

erickt
Copy link
Contributor

@erickt erickt commented Jun 4, 2021

According to the inotify documentation, the only function that returns ENOSPC is inotify_add_watch, so this moves the check for this error code to the inotify.add_watch() call point. This makes sure someone using a different watcher like PollWatcher on linux won't reinterpret this error.

Also, this uses libc::ENOSPC instead of 28 because it's easier to interpret from the inotify documentation.

According to the inotify documentation, the only function that returns
ENOSPC is `inotify_add_watch`, so this moves the check for this error
code to the `inotify.add_watch()` call point. This makes sure someone
using a different watcher like PollWatcher on linux won't reinterpret
this error.

Also, this uses `libc::ENOSPC` instead of `28` because it's easier to
interpret from the inotify documentation.
Copy link
Member

@JohnTitor JohnTitor left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense to me 👍

Copy link
Member

@0xpr03 0xpr03 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks

@0xpr03 0xpr03 merged commit 25cdb88 into notify-rs:main Jun 8, 2021
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.

None yet

3 participants