Skip to content

Commit

Permalink
Backport #285 display correct inotify limit error
Browse files Browse the repository at this point in the history
Signed-off-by: Aron Heinecke <aron.heinecke@t-online.de>
  • Loading branch information
0xpr03 committed Mar 22, 2021
1 parent 7b3c31a commit 821331f
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,10 @@
## 4.0.16 (future)

- FIX: Report events promptly on Linux, even when many occur in rapid succession. [#268]
- FIX: Display proper error message when reaching inotify limits on linux. [#290]

[#268]: https://github.com/notify-rs/notify/pull/268
[#290]: https://github.com/notify-rs/notify/pull/290

## 4.0.15 (2020-01-07)

Expand Down Expand Up @@ -85,7 +87,7 @@
- META: Change commit message style: commits are now prefixed by a `[topic]`.
- FIX: Make sure debounced watcher terminates. [#170]
- FIX: \[Linux\] Remove thread wake-up on timeout (introduced in 4.0.5 by error). [#174]
- FIX: Restore compatibility with Rust before 1.30.0. [`eab75118`]
- FIX: Restore compatibility with Rust before 1.30.0. [`eab75118`]
- META: Enforce compatibility with Rust 1.26.1 via CI. [`50924cd6`]
- META: Add maintenance status badge. [`ecd686ba`]
- DOCS: Freeze v4 branch (2018-10-05) [`8310b2cc`] — and subsequently unfreeze it. (2019-01-19) [`20c40f99`], [`c00da47c`]
Expand Down
7 changes: 7 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -520,6 +520,13 @@ impl StdError for Error {

impl From<io::Error> for Error {
fn from(err: io::Error) -> Error {
// do not report inotify limits as "no more space" on linux #266
#[cfg(target_os = "linux")]
{
if err.raw_os_error() == Some(28) {
return Error::Generic(String::from("Can't watch (more) files, limit on the total number of inotify watches reached"))
}
}
Error::Io(err)
}
}
Expand Down

0 comments on commit 821331f

Please sign in to comment.