diff --git a/Cargo.lock b/Cargo.lock
index 4ba4f19c1bb1c6e2af10b6eeeb95d1f948536c22..96767e4503a2b23e42695faf021482eb21f81550 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -247,9 +247,9 @@ dependencies = [
[[package]]
name = "inotify"
-version = "0.10.1"
+version = "0.9.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ff335215fb898bf09c45833b657233d8c0b699a616d7dd64d0513080da270ab6"
+checksum = "f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff"
dependencies = [
"bitflags",
"futures-core",
@@ -275,9 +275,9 @@ checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6"
[[package]]
name = "js-sys"
-version = "0.3.63"
+version = "0.3.64"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "2f37a4a5928311ac501dee68b3c7613a1037d0edb30c8e5427bd832d55d1b790"
+checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a"
dependencies = [
"wasm-bindgen",
]
@@ -323,9 +323,9 @@ dependencies = [
[[package]]
name = "log"
-version = "0.4.18"
+version = "0.4.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "518ef76f2f87365916b142844c16d8fefd85039bc5699050210a7778ee1cd1de"
+checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4"
dependencies = [
"serde",
]
@@ -778,9 +778,9 @@ checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
[[package]]
name = "wasm-bindgen"
-version = "0.2.86"
+version = "0.2.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5bba0e8cb82ba49ff4e229459ff22a191bbe9a1cb3a341610c9c33efc27ddf73"
+checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342"
dependencies = [
"cfg-if 1.0.0",
"wasm-bindgen-macro",
@@ -788,9 +788,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-backend"
-version = "0.2.86"
+version = "0.2.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "19b04bc93f9d6bdee709f6bd2118f57dd6679cf1176a1af464fca3ab0d66d8fb"
+checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd"
dependencies = [
"bumpalo",
"log",
@@ -803,9 +803,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro"
-version = "0.2.86"
+version = "0.2.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "14d6b024f1a526bb0234f52840389927257beb670610081360e5a03c5df9c258"
+checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d"
dependencies = [
"quote",
"wasm-bindgen-macro-support",
@@ -813,9 +813,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-macro-support"
-version = "0.2.86"
+version = "0.2.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e128beba882dd1eb6200e1dc92ae6c5dbaa4311aa7bb211ca035779e5efc39f8"
+checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b"
dependencies = [
"proc-macro2",
"quote",
@@ -826,9 +826,9 @@ dependencies = [
[[package]]
name = "wasm-bindgen-shared"
-version = "0.2.86"
+version = "0.2.87"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ed9d5b4305409d1fc9482fee2d7f9bcbf24b3972bf59817ef757e23982242a93"
+checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1"
[[package]]
name = "winapi"
diff --git a/Cargo.toml b/Cargo.toml
index 606107b97aeca62d6ba982e3fbbca587b108ee11..a59a3228dae06046d7afc4d105272cc5c48a0111 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -17,5 +17,5 @@ daemonize = "0.x"
serde = { version = "1.0.143", features = ["serde_derive"] }
toml = "0.5.9"
-inotify = "0.10"
+inotify = "0.9"
log = "0.4"
diff --git a/vendor/inotify/.cargo-checksum.json b/vendor/inotify/.cargo-checksum.json
index c505a488054b002bad4305f81b82e89c6416352f..ee5d738021850d3433429c051bb7cf899efbc359 100644
--- a/vendor/inotify/.cargo-checksum.json
+++ b/vendor/inotify/.cargo-checksum.json
@@ -1 +1 @@
-{"files":{"CHANGELOG.md":"c14db09d81fd982fb8dbd708753af28d8893de81b03a9457da345b8014e743fe","CONTRIBUTING.md":"63ec0b71cb5acafb22a3edbd1232d8886ed531544b241d956ca284e4163a05fc","Cargo.lock":"a605895698ab5bb687b1ba52f9482c42d6fa5efe48d6c1411d2b521161f0e949","Cargo.toml":"18b601bcf09d8b847cd07a5f65da6e3a87118fd81d5d560aa346594a04369841","LICENSE":"7f78b31de4e7a3e2ac8de40e2b409eda313f03637aa62b8416fbde9bdc5ce4c9","README.md":"10ab19ad3218e62ad22d8db257b19f60aa897529a06482b6502c5ef36844690a","examples/stream.rs":"3d81838f02e16ceef93a5529dcd37b90dbe83ea5195f6d373972cc5fd9bba770","examples/watch.rs":"3b437c8f8c3813167d41d11183198bb26a21d15485a6abf1d3fab86faeb35cd6","src/events.rs":"9ee64a1b9f993f06397958af7fcbd198166686d1a76fcaccb71fd64b780d88c2","src/fd_guard.rs":"3d9dd97d24e4da26ebbc2a467007ae663bc662037ec5e674368e3dd914a2d084","src/inotify.rs":"dc2f9aa1880c6babf0df6be25abdcb29d96621fe345b43c0b026c17a90b5e92d","src/lib.rs":"1d5a7684fa167fe6ba6e76e97e01ef2f130b2eadac21e5a65a13cac5e05c2e9a","src/stream.rs":"9485e66347153aa1f943ab3b754e7603e29e978abc8add1c58bd7b33a191621f","src/util.rs":"0384fba107edf17bc29dc6694038be6271774d5fc530b01784dac8ec8a8183f6","src/watches.rs":"18c892af2757626c25b99ff948be392c2e29c8abd0d436898856ec0fd5faa9c8","tests/main.rs":"6d70e9c278823db5c5a293bc973c9fb04de0605966c23be03aaf1d97db8e45e4"},"package":"ff335215fb898bf09c45833b657233d8c0b699a616d7dd64d0513080da270ab6"}
\ No newline at end of file
+{"files":{"CHANGELOG.md":"d0584f914aebf070e1be3ca96ef065b94f3234b13e7dcceec93249d8943db067","CONTRIBUTING.md":"63ec0b71cb5acafb22a3edbd1232d8886ed531544b241d956ca284e4163a05fc","Cargo.lock":"c7bbe32ee961e85c7695ed83d80408c14c91748710d857c724a807c1b34f29ee","Cargo.toml":"a3c3ebabfa79a6cf46009630a61911e94964d492cc4208366f49cbc365042d8f","LICENSE":"7f78b31de4e7a3e2ac8de40e2b409eda313f03637aa62b8416fbde9bdc5ce4c9","README.md":"1ea282e675f038a96381e6c77d2968e0a3850342f4155f8b6e2262a8f74a74b2","examples/stream.rs":"38732ec68508a8da91e27efb1f042228544b68744cc565a33a63afdb84b76689","examples/watch.rs":"4a7d222e6579b0ecaf9a9713f469a0d81bacbf294bdc88af657dfd1fd24cee21","src/events.rs":"c3e7e203aa6bf1cfab0865e629f69092e2dcfae97cd2c0ac76c69c04dcf006f5","src/fd_guard.rs":"40ce706cd2eecae278680512796c4b2890c6bd23c565d0ae06adca47ca1589a7","src/inotify.rs":"8843d08098d8ed85513c625be07dcadaf4de27eb7aaf2dec930d2d22efaa0c93","src/lib.rs":"3aca05bbd217d18a6f3b995e9d6e112b5e6dad5327f32058f60cc26f62005aea","src/stream.rs":"6bca1ae58003b3e5643bef13b0b1eb214c9027d9935ac7aacce0861cd24314d1","src/util.rs":"17d21c40a447181f5fb10646cb3e9bc996f93c6f50167db9a8e14086e9ea904d","src/watches.rs":"07e1a61eacb2dade17bc3de09d82f0cc453b7a36062b865916634145278ddb3f","tests/main.rs":"7914fb0d6a5e0991d47b77132744a90b5aa1bf20174df14da9c6395d1340b1e1"},"package":"f8069d3ec154eb856955c1c0fbffefbf5f3c40a104ec912d4797314c1801abff"}
\ No newline at end of file
diff --git a/vendor/inotify/CHANGELOG.md b/vendor/inotify/CHANGELOG.md
index 6e5b0998b000b3a7f9c37fc87ca8b18d455384b7..a5b4dafcdd96dd31ca5c98239d8b26e1c0f6c753 100644
--- a/vendor/inotify/CHANGELOG.md
+++ b/vendor/inotify/CHANGELOG.md
@@ -1,32 +1,4 @@
-# Changelog
-
-## v0.10.1 (2023-06-07)
-
-- Add `WatchDescriptor::get_watch_descriptor_id` ([#193])
-- Add `Event::to_owned` ([#196])
-- Deprecate `Event::into_owned` ([#196])
-- Add `Watches`/`Inotify::watches`/`EventStream::watches` ([#197])
-- Deprecate `Inotify::add_watch`/`Inotify::rm_watch` ([#197])
-- Add `Inotify::into_event_stream`/`EventStream::into_inotify` ([#199])
-- Deprecate `Inotify::event_stream` ([#199])
-- Implement `AsFd` and bidirectional conversion to/from `OwnedFd` ([#202])
-- Raise Minimum Supported Rust Version (MSRV) to 1.63.0 ([#202])
-
-[#193]: https://github.com/hannobraun/inotify-rs/pull/193
-[#196]: https://github.com/hannobraun/inotify-rs/pull/196
-[#197]: https://github.com/hannobraun/inotify-rs/pull/197
-[#199]: https://github.com/hannobraun/inotify-rs/pull/199
-[#202]: https://github.com/hannobraun/inotify-rs/pull/202
-
-
-## v0.10.0 (2021-12-07)
-
-- **Breaking change:** Remove special handling of `WouldBlock` error ([#190])
-
-[#190]: https://github.com/hannobraun/inotify-rs/pull/190
-
-
-## v0.9.6 (2021-11-03)
+### v0.9.6 (2021-10-07)
- Fix build status badge in README ([#185])
- Add `get_buffer_size`/`get_absolute_path_buffer_size` ([#187])
@@ -35,14 +7,14 @@
[#187]: https://github.com/hannobraun/inotify-rs/pull/187
-## v0.9.5 (2021-10-07)
+### v0.9.5 (2021-10-07)
- Implement `Ord`/`PartialOrd` for `WatchDescriptor` ([#183])
[#183]: https://github.com/hannobraun/inotify-rs/pull/183
-## v0.9.4 (2021-09-22)
+### v0.9.4 (2021-09-22)
- Make `Event::into_owned` always available ([#179])
- Implement missing `Debug` implementations ([#180])
@@ -51,7 +23,7 @@
[#180]: https://github.com/hannobraun/inotify-rs/pull/180
-## v0.9.3 (2021-05-12)
+### v0.9.3 (2021-05-12)
- Improve documentation ([#167], [#169])
- Add missing check for invalid file descriptor ([#168])
@@ -65,21 +37,23 @@
[#173]: https://github.com/hannobraun/inotify-rs/pull/173
-## v0.9.2 (2020-12-30)
+### v0.9.2 (2020-12-30)
- Upgrade to Tokio 1.0 ([#165])
[#165]: https://github.com/hannobraun/inotify/pull/165
-## v0.9.1 (2020-11-09)
+
+### v0.9.1 (2020-11-09)
- Fix take wake-up ([#161])
[#161]: https://github.com/hannobraun/inotify/pull/161
-## v0.9.0 (2020-11-06)
+
+### v0.9.0 (2020-11-06)
- Update minimum supported Rust version to version 1.47 ([#154])
- Fix documentation: `Inotify::read_events` doesn't handle all events ([#157])
@@ -90,55 +64,78 @@
[#158]: https://github.com/hannobraun/inotify/pull/158
-## v0.8.3 (2020-06-05)
+
+### v0.8.3 (2020-06-05)
- Avoid using `inotify_init1` ([#146])
[#146]: https://github.com/hannobraun/inotify/pull/146
-## v0.8.2 (2020-01-25)
+
+### v0.8.2 (2020-01-25)
- Ensure file descriptor is closed on drop ([#140])
[#140]: https://github.com/inotify-rs/inotify/pull/140
-## v0.8.1 (2020-01-23)
+
+### v0.8.1 (2020-01-23)
No changes, due to a mistake made while releasing this version.
-## v0.8.0 (2019-12-04)
+
+### v0.8.0 (2019-12-04)
- Update to tokio 0.2 and futures 0.3 ([#134])
[#134]: https://github.com/inotify-rs/inotify/pull/134
-## v0.7.1 (2020-06-05)
+
+### v0.7.1 (2020-06-05)
- backport: Avoid using `inotify_init1` ([#146])
[#146]: https://github.com/hannobraun/inotify/pull/146
-## v0.7.0 (2019-02-09)
+
+### v0.7.0 (2019-02-09)
+
+#### Features
-- Make stream API more flexible in regards to buffers ([ea3e7a394bf34a6ccce4f2136c0991fe7e8f1f42](ea3e7a394bf34a6ccce4f2136c0991fe7e8f1f42)) (breaking change)
+* Make stream API more flexible in regards to buffers ([ea3e7a394bf34a6ccce4f2136c0991fe7e8f1f42](ea3e7a394bf34a6ccce4f2136c0991fe7e8f1f42)) (breaking change)
+
+### v0.6.1 (2018-08-28)
-## v0.6.1 (2018-08-28)
-- Don't return spurious filenames ([2f37560f](2f37560f))
+#### Bug Fixes
+* Don't return spurious filenames ([2f37560f](2f37560f))
+
+
+
## v0.6.0 (2018-08-16)
-- Handle closing of inotify instance better ([824160fe](824160fe))
-- Implement `EventStream` using `mio` ([ba4cb8c7](ba4cb8c7))
+
+#### Features
+
+* Handle closing of inotify instance better ([824160fe](824160fe))
+* Implement `EventStream` using `mio` ([ba4cb8c7](ba4cb8c7))
+
+
+
+
+### v0.5.1 (2018-02-27)
+
+#### Features
+
+* Add future-based async API ([569e65a7](569e65a7), closes [#49](49))
-## v0.5.1 (2018-02-27)
-- Add future-based async API ([569e65a7](569e65a7), closes [#49](49))
diff --git a/vendor/inotify/Cargo.lock b/vendor/inotify/Cargo.lock
index e7bc4aad8b8a18e53f3b5984408120b159d330c5..dcb9ebe423019af29f7d999dda5c8dffc940dea5 100644
--- a/vendor/inotify/Cargo.lock
+++ b/vendor/inotify/Cargo.lock
@@ -4,21 +4,15 @@ version = 3
[[package]]
name = "autocfg"
-version = "1.1.0"
+version = "1.0.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa"
+checksum = "cdb031dd78e28731d87d56cc8ffef4a8f36ca26c38fe2de700543e627f8a464a"
[[package]]
name = "bitflags"
-version = "1.3.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a"
-
-[[package]]
-name = "cc"
-version = "1.0.79"
+version = "1.2.1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f"
+checksum = "cf1de2fe8c75bc145a2f577add951f8134889b4795d47466a54a5c846d691693"
[[package]]
name = "cfg-if"
@@ -26,48 +20,20 @@ version = "1.0.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd"
-[[package]]
-name = "errno"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a"
-dependencies = [
- "errno-dragonfly",
- "libc",
- "windows-sys",
-]
-
-[[package]]
-name = "errno-dragonfly"
-version = "0.1.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf"
-dependencies = [
- "cc",
- "libc",
-]
-
-[[package]]
-name = "fastrand"
-version = "1.9.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be"
-dependencies = [
- "instant",
-]
-
[[package]]
name = "futures-core"
-version = "0.3.28"
+version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c"
+checksum = "0402f765d8a89a26043b889b26ce3c4679d268fa6bb22cd7c6aad98340e179d1"
[[package]]
name = "futures-macro"
-version = "0.3.28"
+version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72"
+checksum = "a4c40298486cdf52cc00cd6d6987892ba502c7656a16a4192a9992b1ccedd121"
dependencies = [
+ "autocfg",
+ "proc-macro-hack",
"proc-macro2",
"quote",
"syn",
@@ -75,29 +41,32 @@ dependencies = [
[[package]]
name = "futures-task"
-version = "0.3.28"
+version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65"
+checksum = "8a16bef9fc1a4dddb5bee51c989e3fbba26569cbb0e31f5b303c184e3dd33dae"
[[package]]
name = "futures-util"
-version = "0.3.28"
+version = "0.3.15"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533"
+checksum = "feb5c238d27e2bf94ffdfd27b2c29e3df4a68c4193bb6427384259e2bf191967"
dependencies = [
+ "autocfg",
"futures-core",
"futures-macro",
"futures-task",
"pin-project-lite",
"pin-utils",
+ "proc-macro-hack",
+ "proc-macro-nested",
"slab",
]
[[package]]
name = "getrandom"
-version = "0.2.10"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427"
+checksum = "c9495705279e7140bf035dde1f6e750c162df8b625267cd52cc44e0b156732c8"
dependencies = [
"cfg-if",
"libc",
@@ -106,30 +75,22 @@ dependencies = [
[[package]]
name = "hermit-abi"
-version = "0.2.6"
+version = "0.1.18"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ee512640fe35acbfb4bb779db6f0d80704c2cacfa2e39b601ef3e3f47d1ae4c7"
+checksum = "322f4de77956e22ed0e5032c359a0f1273f1f7f0d79bfa3b8ffbc730d7fbcc5c"
dependencies = [
"libc",
]
-[[package]]
-name = "hermit-abi"
-version = "0.3.1"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "fed44880c466736ef9a5c5b5facefb5ed0785676d0c02d612db14e54f0d84286"
-
[[package]]
name = "inotify"
-version = "0.10.1"
+version = "0.9.6"
dependencies = [
"bitflags",
"futures-core",
"futures-util",
"inotify-sys",
"libc",
- "maplit",
- "rand",
"tempfile",
"tokio",
]
@@ -144,69 +105,66 @@ dependencies = [
]
[[package]]
-name = "instant"
-version = "0.1.12"
+name = "libc"
+version = "0.2.94"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c"
+checksum = "18794a8ad5b29321f790b55d93dfba91e125cb1a9edbd4f8e3150acc771c1a5e"
+
+[[package]]
+name = "log"
+version = "0.4.14"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "51b9bbe6c47d51fc3e1a9b945965946b4c44142ab8792c50835a980d362c2710"
dependencies = [
"cfg-if",
]
[[package]]
-name = "io-lifetimes"
-version = "1.0.11"
+name = "mio"
+version = "0.7.11"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2"
+checksum = "cf80d3e903b34e0bd7282b218398aec54e082c840d9baf8339e0080a0c542956"
dependencies = [
- "hermit-abi 0.3.1",
"libc",
- "windows-sys",
+ "log",
+ "miow",
+ "ntapi",
+ "winapi",
]
[[package]]
-name = "libc"
-version = "0.2.146"
+name = "miow"
+version = "0.3.7"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "f92be4933c13fd498862a9e02a3055f8a8d9c039ce33db97306fd5a6caa7f29b"
-
-[[package]]
-name = "linux-raw-sys"
-version = "0.3.8"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519"
-
-[[package]]
-name = "maplit"
-version = "1.0.2"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "3e2e65a1a2e43cfcb47a895c4c8b10d1f4a61097f9f254f183aee60cad9c651d"
+checksum = "b9f1c5b025cda876f66ef43a113f91ebc9f4ccef34843000e0adf6ebbab84e21"
+dependencies = [
+ "winapi",
+]
[[package]]
-name = "mio"
-version = "0.8.8"
+name = "ntapi"
+version = "0.3.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2"
+checksum = "3f6bb902e437b6d86e03cce10a7e2af662292c5dfef23b65899ea3ac9354ad44"
dependencies = [
- "libc",
- "wasi",
- "windows-sys",
+ "winapi",
]
[[package]]
name = "num_cpus"
-version = "1.15.0"
+version = "1.13.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "0fac9e2da13b5eb447a6ce3d392f23a29d8694bff781bf03a16cd9ac8697593b"
+checksum = "05499f3756671c15885fee9034446956fff3f243d6077b91e5767df161f766b3"
dependencies = [
- "hermit-abi 0.2.6",
+ "hermit-abi",
"libc",
]
[[package]]
name = "pin-project-lite"
-version = "0.2.9"
+version = "0.2.6"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116"
+checksum = "dc0e1f259c92177c30a4c9d177246edd0a3568b25756a977d0632cf8fa37e905"
[[package]]
name = "pin-utils"
@@ -216,44 +174,57 @@ checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184"
[[package]]
name = "ppv-lite86"
-version = "0.2.17"
+version = "0.2.10"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "ac74c624d6b2d21f425f752262f42188365d7b8ff1aff74c82e45136510a4857"
+
+[[package]]
+name = "proc-macro-hack"
+version = "0.5.19"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de"
+checksum = "dbf0c48bc1d91375ae5c3cd81e3722dff1abcf81a30960240640d223f59fe0e5"
+
+[[package]]
+name = "proc-macro-nested"
+version = "0.1.7"
+source = "registry+https://github.com/rust-lang/crates.io-index"
+checksum = "bc881b2c22681370c6a780e47af9840ef841837bc98118431d4e1868bd0c1086"
[[package]]
name = "proc-macro2"
-version = "1.0.59"
+version = "1.0.26"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6aeca18b86b413c660b781aa319e4e2648a3e6f9eadc9b47e9038e6fe9f3451b"
+checksum = "a152013215dca273577e18d2bf00fa862b89b24169fb78c4c95aeb07992c9cec"
dependencies = [
- "unicode-ident",
+ "unicode-xid",
]
[[package]]
name = "quote"
-version = "1.0.28"
+version = "1.0.9"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1b9ab9c7eadfd8df19006f1cf1a4aed13540ed5cbc047010ece5826e10825488"
+checksum = "c3d0b9745dc2debf507c8422de05d7226cc1f0644216dfdfead988f9b1ab32a7"
dependencies = [
"proc-macro2",
]
[[package]]
name = "rand"
-version = "0.8.5"
+version = "0.8.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404"
+checksum = "0ef9e7e66b4468674bfcb0c81af8b7fa0bb154fa9f28eb840da5c447baeb8d7e"
dependencies = [
"libc",
"rand_chacha",
"rand_core",
+ "rand_hc",
]
[[package]]
name = "rand_chacha"
-version = "0.3.1"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88"
+checksum = "e12735cf05c9e10bf21534da50a147b924d555dc7a547c42e6bb2d5b6017ae0d"
dependencies = [
"ppv-lite86",
"rand_core",
@@ -261,101 +232,90 @@ dependencies = [
[[package]]
name = "rand_core"
-version = "0.6.4"
+version = "0.6.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c"
+checksum = "34cf66eb183df1c5876e2dcf6b13d57340741e8dc255b48e40a26de954d06ae7"
dependencies = [
"getrandom",
]
[[package]]
-name = "redox_syscall"
-version = "0.3.5"
+name = "rand_hc"
+version = "0.3.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29"
+checksum = "3190ef7066a446f2e7f42e239d161e905420ccab01eb967c9eb27d21b2322a73"
dependencies = [
- "bitflags",
+ "rand_core",
]
[[package]]
-name = "rustix"
-version = "0.37.19"
+name = "redox_syscall"
+version = "0.2.8"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "acf8729d8542766f1b2cf77eb034d52f40d375bb8b615d0b147089946e16613d"
+checksum = "742739e41cd49414de871ea5e549afb7e2a3ac77b589bcbebe8c82fab37147fc"
dependencies = [
"bitflags",
- "errno",
- "io-lifetimes",
- "libc",
- "linux-raw-sys",
- "windows-sys",
]
[[package]]
-name = "slab"
-version = "0.4.8"
+name = "remove_dir_all"
+version = "0.5.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d"
+checksum = "3acd125665422973a33ac9d3dd2df85edad0f4ae9b00dafb1a05e43a9f5ef8e7"
dependencies = [
- "autocfg",
+ "winapi",
]
[[package]]
-name = "socket2"
-version = "0.4.9"
+name = "slab"
+version = "0.4.3"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662"
-dependencies = [
- "libc",
- "winapi",
-]
+checksum = "f173ac3d1a7e3b28003f40de0b5ce7fe2710f9b9dc3fc38664cebee46b3b6527"
[[package]]
name = "syn"
-version = "2.0.18"
+version = "1.0.72"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "32d41677bcbe24c20c52e7c70b0d8db04134c5d1066bf98662e2871ad200ea3e"
+checksum = "a1e8cdbefb79a9a5a65e0db8b47b723ee907b7c7f8496c76a1770b5c310bab82"
dependencies = [
"proc-macro2",
"quote",
- "unicode-ident",
+ "unicode-xid",
]
[[package]]
name = "tempfile"
-version = "3.6.0"
+version = "3.2.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6"
+checksum = "dac1c663cfc93810f88aed9b8941d48cabf856a1b111c29a40439018d870eb22"
dependencies = [
- "autocfg",
"cfg-if",
- "fastrand",
+ "libc",
+ "rand",
"redox_syscall",
- "rustix",
- "windows-sys",
+ "remove_dir_all",
+ "winapi",
]
[[package]]
name = "tokio"
-version = "1.28.2"
+version = "1.5.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "94d7b1cfd2aa4011f2de74c2c4c63665e27a71006b0a192dcd2710272e73dfa2"
+checksum = "83f0c8e7c0addab50b663055baf787d0af7f413a46e6e7fb9559a4e4db7137a5"
dependencies = [
"autocfg",
"libc",
"mio",
"num_cpus",
"pin-project-lite",
- "socket2",
"tokio-macros",
- "windows-sys",
]
[[package]]
name = "tokio-macros"
-version = "2.1.0"
+version = "1.1.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e"
+checksum = "caf7b11a536f46a809a8a9f0bb4237020f70ecbf115b842360afb127ea2fda57"
dependencies = [
"proc-macro2",
"quote",
@@ -363,16 +323,16 @@ dependencies = [
]
[[package]]
-name = "unicode-ident"
-version = "1.0.9"
+name = "unicode-xid"
+version = "0.2.2"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b15811caf2415fb889178633e7724bad2509101cde276048e013b9def5e51fa0"
+checksum = "8ccb82d61f80a663efe1f787a51b16b5a51e3314d6ac365b08639f52387b33f3"
[[package]]
name = "wasi"
-version = "0.11.0+wasi-snapshot-preview1"
+version = "0.10.2+wasi-snapshot-preview1"
source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423"
+checksum = "fd6fbd9a79829dd1ad0cc20627bf1ed606756a7f77edff7b66b7064f9cb327c6"
[[package]]
name = "winapi"
@@ -395,69 +355,3 @@ name = "winapi-x86_64-pc-windows-gnu"
version = "0.4.0"
source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f"
-
-[[package]]
-name = "windows-sys"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9"
-dependencies = [
- "windows-targets",
-]
-
-[[package]]
-name = "windows-targets"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7b1eb6f0cd7c80c79759c929114ef071b87354ce476d9d94271031c0497adfd5"
-dependencies = [
- "windows_aarch64_gnullvm",
- "windows_aarch64_msvc",
- "windows_i686_gnu",
- "windows_i686_msvc",
- "windows_x86_64_gnu",
- "windows_x86_64_gnullvm",
- "windows_x86_64_msvc",
-]
-
-[[package]]
-name = "windows_aarch64_gnullvm"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc"
-
-[[package]]
-name = "windows_aarch64_msvc"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3"
-
-[[package]]
-name = "windows_i686_gnu"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241"
-
-[[package]]
-name = "windows_i686_msvc"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00"
-
-[[package]]
-name = "windows_x86_64_gnu"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1"
-
-[[package]]
-name = "windows_x86_64_gnullvm"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953"
-
-[[package]]
-name = "windows_x86_64_msvc"
-version = "0.48.0"
-source = "registry+https://github.com/rust-lang/crates.io-index"
-checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a"
diff --git a/vendor/inotify/Cargo.toml b/vendor/inotify/Cargo.toml
index 320595f13cba6bfc377806cfd76b45f7c3cb2204..3d4f199360d61d17353a465e0ab3e0477ce4978b 100644
--- a/vendor/inotify/Cargo.toml
+++ b/vendor/inotify/Cargo.toml
@@ -11,30 +11,15 @@
[package]
edition = "2018"
-rust-version = "1.63"
name = "inotify"
-version = "0.10.1"
-authors = [
- "Hanno Braun ",
- "Félix Saparelli ",
- "Cristian Kubis ",
- "Frank Denis ",
-]
-exclude = [
- "/.travis.yml",
- "/inotify-rs.sublime-project",
-]
+version = "0.9.6"
+authors = ["Hanno Braun ", "Félix Saparelli ", "Cristian Kubis ", "Frank Denis "]
+exclude = ["/.travis.yml", "/inotify-rs.sublime-project"]
description = "Idiomatic wrapper for inotify"
documentation = "https://docs.rs/inotify"
readme = "README.md"
-keywords = [
- "inotify",
- "linux",
-]
-categories = [
- "api-bindings",
- "filesystem",
-]
+keywords = ["inotify", "linux"]
+categories = ["api-bindings", "filesystem"]
license = "ISC"
repository = "https://github.com/hannobraun/inotify"
@@ -44,7 +29,6 @@ required-features = ["stream"]
[[example]]
name = "watch"
-
[dependencies.bitflags]
version = "1"
@@ -62,33 +46,19 @@ version = "0.2"
version = "1.0.1"
features = ["net"]
optional = true
-
[dev-dependencies.futures-util]
version = "0.3.1"
-[dev-dependencies.maplit]
-version = "1.0"
-
-[dev-dependencies.rand]
-version = "0.8"
-
[dev-dependencies.tempfile]
version = "3.1.0"
[dev-dependencies.tokio]
version = "1.0.1"
-features = [
- "macros",
- "rt-multi-thread",
-]
+features = ["macros", "rt-multi-thread"]
[features]
default = ["stream"]
-stream = [
- "futures-core",
- "tokio",
-]
-
+stream = ["futures-core", "tokio"]
[badges.maintenance]
status = "actively-developed"
diff --git a/vendor/inotify/README.md b/vendor/inotify/README.md
index f3d27f41bf5667e7212223152e21174057eaf269..ba91cdce9e638151bfdfda3d24930e5aecf18453 100644
--- a/vendor/inotify/README.md
+++ b/vendor/inotify/README.md
@@ -23,8 +23,7 @@ fn main() {
.expect("Failed to determine current directory");
inotify
- .watches()
- .add(
+ .add_watch(
current_dir,
WatchMask::MODIFY | WatchMask::CREATE | WatchMask::DELETE,
)
@@ -70,7 +69,7 @@ Include it in your `Cargo.toml`:
```toml
[dependencies]
-inotify = "0.10"
+inotify = "0.9"
```
Please refer to the [documentation] and the example above, for information on how to use it in your code.
diff --git a/vendor/inotify/examples/stream.rs b/vendor/inotify/examples/stream.rs
index ca2282f56874f5f7d42d0672ef26ee9278b67dc2..f2e6b88f9899f160a2ce3c5d2a7d112abc687ec6 100644
--- a/vendor/inotify/examples/stream.rs
+++ b/vendor/inotify/examples/stream.rs
@@ -14,12 +14,12 @@ use tempfile::TempDir;
#[tokio::main]
async fn main() -> Result<(), io::Error> {
- let inotify = Inotify::init()
+ let mut inotify = Inotify::init()
.expect("Failed to initialize inotify");
let dir = TempDir::new()?;
- inotify.watches().add(dir.path(), WatchMask::CREATE | WatchMask::MODIFY)?;
+ inotify.add_watch(dir.path(), WatchMask::CREATE | WatchMask::MODIFY)?;
thread::spawn::<_, Result<(), io::Error>>(move || {
loop {
@@ -29,7 +29,7 @@ async fn main() -> Result<(), io::Error> {
});
let mut buffer = [0; 1024];
- let mut stream = inotify.into_event_stream(&mut buffer)?;
+ let mut stream = inotify.event_stream(&mut buffer)?;
while let Some(event_or_error) = stream.next().await {
println!("event: {:?}", event_or_error?);
diff --git a/vendor/inotify/examples/watch.rs b/vendor/inotify/examples/watch.rs
index 8bdeb7b5dbf6f369c43308ec4f68ae92b5fca333..c86ff17ca90f0396a7c151d84e14b58d4a01b75f 100644
--- a/vendor/inotify/examples/watch.rs
+++ b/vendor/inotify/examples/watch.rs
@@ -15,8 +15,7 @@ fn main() {
.expect("Failed to determine current directory");
inotify
- .watches()
- .add(
+ .add_watch(
current_dir,
WatchMask::MODIFY | WatchMask::CREATE | WatchMask::DELETE,
)
diff --git a/vendor/inotify/src/events.rs b/vendor/inotify/src/events.rs
index 1cd508c30f9d3a8223b0c3b0a0f2bbc4945669bc..2c5e010bfcead22499f6ddb5fb694d8f4d7fd518 100644
--- a/vendor/inotify/src/events.rs
+++ b/vendor/inotify/src/events.rs
@@ -12,6 +12,7 @@ use inotify_sys as ffi;
use crate::fd_guard::FdGuard;
use crate::watches::WatchDescriptor;
+use crate::util::align_buffer;
/// Iterator over inotify events
@@ -34,10 +35,10 @@ impl<'a> Events<'a> {
-> Self
{
Events {
- fd,
- buffer,
- num_bytes,
- pos: 0,
+ fd : fd,
+ buffer : buffer,
+ num_bytes: num_bytes,
+ pos : 0,
}
}
}
@@ -62,26 +63,26 @@ impl<'a> Iterator for Events<'a> {
/// An inotify event
///
/// A file system event that describes a change that the user previously
-/// registered interest in. To watch for events, call [`Watches::add`]. To
+/// registered interest in. To watch for events, call [`Inotify::add_watch`]. To
/// retrieve events, call [`Inotify::read_events_blocking`] or
/// [`Inotify::read_events`].
///
-/// [`Watches::add`]: struct.Watches.html#method.add
+/// [`Inotify::add_watch`]: struct.Inotify.html#method.add_watch
/// [`Inotify::read_events_blocking`]: struct.Inotify.html#method.read_events_blocking
/// [`Inotify::read_events`]: struct.Inotify.html#method.read_events
#[derive(Clone, Debug)]
pub struct Event {
/// Identifies the watch this event originates from
///
- /// This [`WatchDescriptor`] is equal to the one that [`Watches::add`]
+ /// This [`WatchDescriptor`] is equal to the one that [`Inotify::add_watch`]
/// returned when interest for this event was registered. The
/// [`WatchDescriptor`] can be used to remove the watch using
- /// [`Watches::remove`], thereby preventing future events of this type
+ /// [`Inotify::rm_watch`], thereby preventing future events of this type
/// from being created.
///
/// [`WatchDescriptor`]: struct.WatchDescriptor.html
- /// [`Watches::add`]: struct.Watches.html#method.add
- /// [`Watches::remove`]: struct.Watches.html#method.remove
+ /// [`Inotify::add_watch`]: struct.Inotify.html#method.add_watch
+ /// [`Inotify::rm_watch`]: struct.Inotify.html#method.rm_watch
pub wd: WatchDescriptor,
/// Indicates what kind of event this is
@@ -117,7 +118,7 @@ impl<'a> Event<&'a OsStr> {
fd,
};
- let name = if name.is_empty() {
+ let name = if name == "" {
None
}
else {
@@ -149,32 +150,37 @@ impl<'a> Event<&'a OsStr> {
-> (usize, Self)
{
let event_size = mem::size_of::();
+ let event_align = mem::align_of::();
+
+ // Make sure that the buffer can satisfy the alignment requirements for `inotify_event`
+ assert!(buffer.len() >= event_align);
+
+ // Discard the unaligned portion, if any, of the supplied buffer
+ let buffer = align_buffer(buffer);
- // Make sure that the buffer is big enough to contain an event, without
+ // Make sure that the aligned buffer is big enough to contain an event, without
// the name. Otherwise we can't safely convert it to an `inotify_event`.
assert!(buffer.len() >= event_size);
- let ffi_event_ptr = buffer.as_ptr() as *const ffi::inotify_event;
+
+ let event = buffer.as_ptr() as *const ffi::inotify_event;
// We have a pointer to an `inotify_event`, pointing to the beginning of
// `buffer`. Since we know, as per the assertion above, that there are
// enough bytes in the buffer for at least one event, we can safely
- // read that `inotify_event`.
- // We call `read_unaligned()` since the byte buffer has alignment 1
- // and `inotify_event` has a higher alignment, so `*` cannot be used to dereference
- // the unaligned pointer (undefined behavior).
- let ffi_event = unsafe { ffi_event_ptr.read_unaligned() };
+ // convert that pointer into a reference.
+ let event = unsafe { &*event };
// The name's length is given by `event.len`. There should always be
// enough bytes left in the buffer to fit the name. Let's make sure that
// is the case.
let bytes_left_in_buffer = buffer.len() - event_size;
- assert!(bytes_left_in_buffer >= ffi_event.len as usize);
+ assert!(bytes_left_in_buffer >= event.len as usize);
// Directly after the event struct should be a name, if there's one
// associated with the event. Let's make a new slice that starts with
// that name. If there's no name, this slice might have a length of `0`.
- let bytes_consumed = event_size + ffi_event.len as usize;
+ let bytes_consumed = event_size + event.len as usize;
let name = &buffer[event_size..bytes_consumed];
// Remove trailing '\0' bytes
@@ -192,23 +198,16 @@ impl<'a> Event<&'a OsStr> {
let event = Event::new(
fd,
- &ffi_event,
+ event,
OsStr::from_bytes(name),
);
(bytes_consumed, event)
}
- /// Returns an owned copy of the event.
- #[deprecated = "use `to_owned()` instead; methods named `into_owned()` usually take self by value"]
- #[allow(clippy::wrong_self_convention)]
- pub fn into_owned(&self) -> EventOwned {
- self.to_owned()
- }
-
/// Returns an owned copy of the event.
#[must_use = "cloning is often expensive and is not expected to have side effects"]
- pub fn to_owned(&self) -> EventOwned {
+ pub fn into_owned(&self) -> EventOwned {
Event {
wd: self.wd.clone(),
mask: self.mask,
@@ -351,7 +350,7 @@ bitflags! {
/// Watch was removed
///
/// This event will be generated, if the watch was removed explicitly
- /// (via [`Watches::remove`]), or automatically (because the file was
+ /// (via [`Inotify::rm_watch`]), or automatically (because the file was
/// deleted or the file system was unmounted).
///
/// See [`inotify_sys::IN_IGNORED`].
@@ -402,6 +401,8 @@ mod tests {
sync,
};
+ use crate::util;
+
use inotify_sys as ffi;
use super::Event;
@@ -411,6 +412,9 @@ mod tests {
fn from_buffer_should_not_mistake_next_event_for_name_of_previous_event() {
let mut buffer = [0u8; 1024];
+ // Make sure the buffer is properly aligned before writing raw events into it
+ let buffer = util::align_buffer_mut(&mut buffer);
+
// First, put a normal event into the buffer
let event = ffi::inotify_event {
wd: 0,
diff --git a/vendor/inotify/src/fd_guard.rs b/vendor/inotify/src/fd_guard.rs
index dfadfcd8f831648da0a7f1fc1fce929ded1d8a9a..cd16078da23f8fcdcb9754d315571ad5d2c10807 100644
--- a/vendor/inotify/src/fd_guard.rs
+++ b/vendor/inotify/src/fd_guard.rs
@@ -1,9 +1,7 @@
use std::{
ops::Deref,
os::unix::io::{
- AsFd,
AsRawFd,
- BorrowedFd,
FromRawFd,
IntoRawFd,
RawFd,
@@ -79,13 +77,6 @@ impl AsRawFd for FdGuard {
}
}
-impl AsFd for FdGuard {
- #[inline]
- fn as_fd(&self) -> BorrowedFd<'_> {
- unsafe { BorrowedFd::borrow_raw(self.fd) }
- }
-}
-
impl PartialEq for FdGuard {
fn eq(&self, other: &FdGuard) -> bool {
self.fd == other.fd
diff --git a/vendor/inotify/src/inotify.rs b/vendor/inotify/src/inotify.rs
index acfd9587074c25b7bc129a310b22028cd029cc46..10099eed42e0e65edfe363269a5045337e14cb98 100644
--- a/vendor/inotify/src/inotify.rs
+++ b/vendor/inotify/src/inotify.rs
@@ -1,12 +1,11 @@
use std::{
+ ffi::CString,
io,
+ os::unix::ffi::OsStrExt,
os::unix::io::{
- AsFd,
AsRawFd,
- BorrowedFd,
FromRawFd,
IntoRawFd,
- OwnedFd,
RawFd,
},
path::Path,
@@ -19,7 +18,9 @@ use std::{
use inotify_sys as ffi;
use libc::{
F_GETFL,
+ F_SETFD,
F_SETFL,
+ FD_CLOEXEC,
O_NONBLOCK,
fcntl,
};
@@ -30,7 +31,6 @@ use crate::util::read_into_buffer;
use crate::watches::{
WatchDescriptor,
WatchMask,
- Watches,
};
@@ -85,29 +85,34 @@ impl Inotify {
/// [`IN_CLOEXEC`]: ../inotify_sys/constant.IN_CLOEXEC.html
/// [`IN_NONBLOCK`]: ../inotify_sys/constant.IN_NONBLOCK.html
pub fn init() -> io::Result {
+ // Initialize inotify and set CLOEXEC and NONBLOCK flags.
+ //
+ // NONBLOCK is needed, because `Inotify` manages blocking behavior for
+ // the API consumer, and the way we do that is to make everything non-
+ // blocking by default and later override that as required.
+ //
+ // CLOEXEC prevents leaking file descriptors to processes executed by
+ // this process and seems to be a best practice. I don't grasp this
+ // issue completely and failed to find any authoritative sources on the
+ // topic. There's some discussion in the open(2) and fcntl(2) man pages,
+ // but I didn't find that helpful in understanding the issue of leaked
+ // file descriptors. For what it's worth, there's a Rust issue about
+ // this:
+ // https://github.com/rust-lang/rust/issues/12148
let fd = unsafe {
- // Initialize inotify and pass both `IN_CLOEXEC` and `IN_NONBLOCK`.
- //
- // `IN_NONBLOCK` is needed, because `Inotify` manages blocking
- // behavior for the API consumer, and the way we do that is to make
- // everything non-blocking by default and later override that as
- // required.
- //
- // Passing `IN_CLOEXEC` prevents leaking file descriptors to
- // processes executed by this process and seems to be a best
- // practice. I don't grasp this issue completely and failed to find
- // any authoritative sources on the topic. There's some discussion in
- // the open(2) and fcntl(2) man pages, but I didn't find that
- // helpful in understanding the issue of leaked file descriptors.
- // For what it's worth, there's a Rust issue about this:
- // https://github.com/rust-lang/rust/issues/12148
- ffi::inotify_init1(ffi::IN_CLOEXEC | ffi::IN_NONBLOCK)
+ let fd = ffi::inotify_init();
+ if fd == -1 {
+ return Err(io::Error::last_os_error());
+ }
+ if fcntl(fd, F_SETFD, FD_CLOEXEC) == -1 {
+ return Err(io::Error::last_os_error());
+ }
+ if fcntl(fd, F_SETFL, O_NONBLOCK) == -1 {
+ return Err(io::Error::last_os_error());
+ }
+ fd
};
- if fd == -1 {
- return Err(io::Error::last_os_error());
- }
-
Ok(Inotify {
fd: Arc::new(FdGuard {
fd,
@@ -116,28 +121,157 @@ impl Inotify {
})
}
- /// Gets an interface that allows adding and removing watches.
- /// See [`Watches::add`] and [`Watches::remove`].
+ /// Adds or updates a watch for the given path
///
- /// [`Watches::add`]: struct.Watches.html#method.add
- /// [`Watches::remove`]: struct.Watches.html#method.remove
- pub fn watches(&self) -> Watches {
- Watches::new(self.fd.clone())
- }
-
- /// Deprecated: use `Inotify.watches().add()` instead
- #[deprecated = "use `Inotify.watches().add()` instead"]
+ /// Adds a new watch or updates an existing one for the file referred to by
+ /// `path`. Returns a watch descriptor that can be used to refer to this
+ /// watch later.
+ ///
+ /// The `mask` argument defines what kind of changes the file should be
+ /// watched for, and how to do that. See the documentation of [`WatchMask`]
+ /// for details.
+ ///
+ /// If this method is used to add a new watch, a new [`WatchDescriptor`] is
+ /// returned. If it is used to update an existing watch, a
+ /// [`WatchDescriptor`] that equals the previously returned
+ /// [`WatchDescriptor`] for that watch is returned instead.
+ ///
+ /// Under the hood, this method just calls [`inotify_add_watch`] and does
+ /// some trivial translation between the types on the Rust side and the C
+ /// side.
+ ///
+ /// # Attention: Updating watches and hardlinks
+ ///
+ /// As mentioned above, this method can be used to update an existing watch.
+ /// This is usually done by calling this method with the same `path`
+ /// argument that it has been called with before. But less obviously, it can
+ /// also happen if the method is called with a different path that happens
+ /// to link to the same inode.
+ ///
+ /// You can detect this by keeping track of [`WatchDescriptor`]s and the
+ /// paths they have been returned for. If the same [`WatchDescriptor`] is
+ /// returned for a different path (and you haven't freed the
+ /// [`WatchDescriptor`] by removing the watch), you know you have two paths
+ /// pointing to the same inode, being watched by the same watch.
+ ///
+ /// # Errors
+ ///
+ /// Directly returns the error from the call to
+ /// [`inotify_add_watch`][`inotify_add_watch`] (translated into an
+ /// `io::Error`), without adding any error conditions of
+ /// its own.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// use inotify::{
+ /// Inotify,
+ /// WatchMask,
+ /// };
+ ///
+ /// let mut inotify = Inotify::init()
+ /// .expect("Failed to initialize an inotify instance");
+ ///
+ /// # // Create a temporary file, so `add_watch` won't return an error.
+ /// # use std::fs::File;
+ /// # File::create("/tmp/inotify-rs-test-file")
+ /// # .expect("Failed to create test file");
+ /// #
+ /// inotify.add_watch("/tmp/inotify-rs-test-file", WatchMask::MODIFY)
+ /// .expect("Failed to add file watch");
+ ///
+ /// // Handle events for the file here
+ /// ```
+ ///
+ /// [`inotify_add_watch`]: ../inotify_sys/fn.inotify_add_watch.html
+ /// [`WatchMask`]: struct.WatchMask.html
+ /// [`WatchDescriptor`]: struct.WatchDescriptor.html
pub fn add_watch
(&mut self, path: P, mask: WatchMask)
-> io::Result
where P: AsRef
{
- self.watches().add(path, mask)
+ let path = CString::new(path.as_ref().as_os_str().as_bytes())?;
+
+ let wd = unsafe {
+ ffi::inotify_add_watch(
+ **self.fd,
+ path.as_ptr() as *const _,
+ mask.bits(),
+ )
+ };
+
+ match wd {
+ -1 => Err(io::Error::last_os_error()),
+ _ => Ok(WatchDescriptor{ id: wd, fd: Arc::downgrade(&self.fd) }),
+ }
}
- /// Deprecated: use `Inotify.watches().remove()` instead
- #[deprecated = "use `Inotify.watches().remove()` instead"]
+ /// Stops watching a file
+ ///
+ /// Removes the watch represented by the provided [`WatchDescriptor`] by
+ /// calling [`inotify_rm_watch`]. [`WatchDescriptor`]s can be obtained via
+ /// [`Inotify::add_watch`], or from the `wd` field of [`Event`].
+ ///
+ /// # Errors
+ ///
+ /// Directly returns the error from the call to [`inotify_rm_watch`].
+ /// Returns an [`io::Error`] with [`ErrorKind`]`::InvalidInput`, if the given
+ /// [`WatchDescriptor`] did not originate from this [`Inotify`] instance.
+ ///
+ /// # Examples
+ ///
+ /// ```
+ /// use inotify::Inotify;
+ ///
+ /// let mut inotify = Inotify::init()
+ /// .expect("Failed to initialize an inotify instance");
+ ///
+ /// # // Create a temporary file, so `add_watch` won't return an error.
+ /// # use std::fs::File;
+ /// # let mut test_file = File::create("/tmp/inotify-rs-test-file")
+ /// # .expect("Failed to create test file");
+ /// #
+ /// # // Add a watch and modify the file, so the code below doesn't block
+ /// # // forever.
+ /// # use inotify::WatchMask;
+ /// # inotify.add_watch("/tmp/inotify-rs-test-file", WatchMask::MODIFY)
+ /// # .expect("Failed to add file watch");
+ /// # use std::io::Write;
+ /// # write!(&mut test_file, "something\n")
+ /// # .expect("Failed to write something to test file");
+ /// #
+ /// let mut buffer = [0; 1024];
+ /// let events = inotify
+ /// .read_events_blocking(&mut buffer)
+ /// .expect("Error while waiting for events");
+ ///
+ /// for event in events {
+ /// inotify.rm_watch(event.wd);
+ /// }
+ /// ```
+ ///
+ /// [`WatchDescriptor`]: struct.WatchDescriptor.html
+ /// [`inotify_rm_watch`]: ../inotify_sys/fn.inotify_rm_watch.html
+ /// [`Inotify::add_watch`]: struct.Inotify.html#method.add_watch
+ /// [`Event`]: struct.Event.html
+ /// [`Inotify`]: struct.Inotify.html
+ /// [`io::Error`]: https://doc.rust-lang.org/std/io/struct.Error.html
+ /// [`ErrorKind`]: https://doc.rust-lang.org/std/io/enum.ErrorKind.html
pub fn rm_watch(&mut self, wd: WatchDescriptor) -> io::Result<()> {
- self.watches().remove(wd)
+ if wd.fd.upgrade().as_ref() != Some(&self.fd) {
+ return Err(io::Error::new(
+ io::ErrorKind::InvalidInput,
+ "Invalid WatchDescriptor",
+ ));
+ }
+
+ let result = unsafe { ffi::inotify_rm_watch(**self.fd, wd.id) };
+ match result {
+ 0 => Ok(()),
+ -1 => Err(io::Error::last_os_error()),
+ _ => panic!(
+ "unexpected return code from inotify_rm_watch ({})", result)
+ }
}
/// Waits until events are available, then returns them
@@ -193,8 +327,9 @@ impl Inotify {
///
/// # Errors
///
- /// This function directly returns all errors from the call to [`read`].
- /// In addition, [`ErrorKind::UnexpectedEof`] is returned, if the call to
+ /// This function directly returns all errors from the call to [`read`]
+ /// (except EGAIN/EWOULDBLOCK, which result in an empty iterator). In
+ /// addition, [`ErrorKind::UnexpectedEof`] is returned, if the call to
/// [`read`] returns `0`, signaling end-of-file.
///
/// If `buffer` is too small, this will result in an error with
@@ -203,21 +338,15 @@ impl Inotify {
///
/// # Examples
///
- /// ```no_run
+ /// ```
/// use inotify::Inotify;
- /// use std::io::ErrorKind;
///
/// let mut inotify = Inotify::init()
/// .expect("Failed to initialize an inotify instance");
///
/// let mut buffer = [0; 1024];
- /// let events = loop {
- /// match inotify.read_events(&mut buffer) {
- /// Ok(events) => break events,
- /// Err(error) if error.kind() == ErrorKind::WouldBlock => continue,
- /// _ => panic!("Error while reading events"),
- /// }
- /// };
+ /// let events = inotify.read_events(&mut buffer)
+ /// .expect("Error while reading events");
///
/// for event in events {
/// // Handle event
@@ -244,7 +373,12 @@ impl Inotify {
}
-1 => {
let error = io::Error::last_os_error();
- return Err(error);
+ if error.kind() == io::ErrorKind::WouldBlock {
+ return Ok(Events::new(Arc::downgrade(&self.fd), buffer, 0));
+ }
+ else {
+ return Err(error);
+ }
},
_ if num_bytes < 0 => {
panic!("{} {} {} {} {} {}",
@@ -273,43 +407,19 @@ impl Inotify {
Ok(Events::new(Arc::downgrade(&self.fd), buffer, num_bytes))
}
- /// Deprecated: use `into_event_stream()` instead, which enforces a single `Stream` and predictable reads.
- /// Using this method to create multiple `EventStream` instances from one `Inotify` is unsupported,
- /// as they will contend over one event source and each produce unpredictable stream contents.
- #[deprecated = "use `into_event_stream()` instead, which enforces a single Stream and predictable reads"]
- #[cfg(feature = "stream")]
- pub fn event_stream(&mut self, buffer: T)
- -> io::Result>
- where
- T: AsMut<[u8]> + AsRef<[u8]>,
- {
- EventStream::new(self.fd.clone(), buffer)
- }
-
- /// Create a stream which collects events. Consumes the `Inotify` instance.
+ /// Create a stream which collects events
///
/// Returns a `Stream` over all events that are available. This stream is an
/// infinite source of events.
///
/// An internal buffer which can hold the largest possible event is used.
#[cfg(feature = "stream")]
- pub fn into_event_stream(self, buffer: T)
+ pub fn event_stream(&mut self, buffer: T)
-> io::Result>
where
T: AsMut<[u8]> + AsRef<[u8]>,
{
- EventStream::new(self.fd, buffer)
- }
-
- /// Creates an `Inotify` instance using the file descriptor which was originally
- /// initialized in `Inotify::init`. This is intended to be used to transform an
- /// `EventStream` back into an `Inotify`. Do not attempt to clone `Inotify` with this.
- #[cfg(feature = "stream")]
- pub(crate) fn from_file_descriptor(fd: Arc) -> Self
- {
- Inotify {
- fd,
- }
+ EventStream::new(self.fd.clone(), buffer)
}
/// Closes the inotify instance
@@ -373,22 +483,3 @@ impl IntoRawFd for Inotify {
self.fd.fd
}
}
-
-impl AsFd for Inotify {
- #[inline]
- fn as_fd(&self) -> BorrowedFd<'_> {
- self.fd.as_fd()
- }
-}
-
-impl From for OwnedFd {
- fn from(fd: Inotify) -> OwnedFd {
- unsafe { OwnedFd::from_raw_fd(fd.into_raw_fd()) }
- }
-}
-
-impl From for Inotify {
- fn from(fd: OwnedFd) -> Inotify {
- unsafe { Inotify::from_raw_fd(fd.into_raw_fd()) }
- }
-}
diff --git a/vendor/inotify/src/lib.rs b/vendor/inotify/src/lib.rs
index b037ae156aacfea2c7846dc6cac23d7f16d44501..7375ee552caca8c4f56ce97e504d5ee12b7bbf69 100644
--- a/vendor/inotify/src/lib.rs
+++ b/vendor/inotify/src/lib.rs
@@ -19,15 +19,14 @@
//! let mut inotify = Inotify::init()
//! .expect("Error while initializing inotify instance");
//!
-//! # // Create a temporary file, so `Watches::add` won't return an error.
+//! # // Create a temporary file, so `add_watch` won't return an error.
//! # use std::fs::File;
//! # let mut test_file = File::create("/tmp/inotify-rs-test-file")
//! # .expect("Failed to create test file");
//! #
//! // Watch for modify and close events.
//! inotify
-//! .watches()
-//! .add(
+//! .add_watch(
//! "/tmp/inotify-rs-test-file",
//! WatchMask::MODIFY | WatchMask::CLOSE,
//! )
@@ -38,7 +37,7 @@
//! # write!(&mut test_file, "something\n")
//! # .expect("Failed to write something to test file");
//! #
-//! // Read events that were added with `Watches::add` above.
+//! // Read events that were added with `add_watch` above.
//! let mut buffer = [0; 1024];
//! let events = inotify.read_events_blocking(&mut buffer)
//! .expect("Error while reading events");
diff --git a/vendor/inotify/src/stream.rs b/vendor/inotify/src/stream.rs
index 65a2e3c7f87d4b7380036bbd2c7f8b5ca0402138..bad0ec1345e388a8e125a091b01d7eb77387d810 100644
--- a/vendor/inotify/src/stream.rs
+++ b/vendor/inotify/src/stream.rs
@@ -11,15 +11,13 @@ use tokio::io::unix::AsyncFd;
use crate::events::{Event, EventOwned};
use crate::fd_guard::FdGuard;
-use crate::Inotify;
use crate::util::read_into_buffer;
-use crate::watches::Watches;
/// Stream of inotify events
///
-/// Allows for streaming events returned by [`Inotify::into_event_stream`].
+/// Allows for streaming events returned by [`Inotify::event_stream`].
///
-/// [`Inotify::into_event_stream`]: struct.Inotify.html#method.into_event_stream
+/// [`Inotify::event_stream`]: struct.Inotify.html#method.event_stream
#[derive(Debug)]
pub struct EventStream {
fd: AsyncFd,
@@ -36,26 +34,11 @@ where
pub(crate) fn new(fd: Arc, buffer: T) -> io::Result {
Ok(EventStream {
fd: AsyncFd::new(ArcFdGuard(fd))?,
- buffer,
+ buffer: buffer,
buffer_pos: 0,
unused_bytes: 0,
})
}
-
- /// Returns an instance of `Watches` to add and remove watches.
- /// See [`Watches::add`] and [`Watches::remove`].
- ///
- /// [`Watches::add`]: struct.Watches.html#method.add
- /// [`Watches::remove`]: struct.Watches.html#method.remove
- pub fn watches(&self) -> Watches {
- Watches::new(self.fd.get_ref().0.clone())
- }
-
- /// Consumes the `EventStream` instance and returns an `Inotify` using the original
- /// file descriptor that was passed from `Inotify` to create the `EventStream`.
- pub fn into_inotify(self) -> Inotify {
- Inotify::from_file_descriptor(self.fd.into_inner().0)
- }
}
impl Stream for EventStream
@@ -90,7 +73,7 @@ where
self_.buffer_pos += bytes_consumed;
self_.unused_bytes -= bytes_consumed;
- Poll::Ready(Some(Ok(event.to_owned())))
+ Poll::Ready(Some(Ok(event.into_owned())))
}
}
diff --git a/vendor/inotify/src/util.rs b/vendor/inotify/src/util.rs
index 24f8eedb3fa8241631282615eaae2f1b386eefd8..25ddb03b9a620dc14370ba3ace2b9d80a86bd490 100644
--- a/vendor/inotify/src/util.rs
+++ b/vendor/inotify/src/util.rs
@@ -15,6 +15,9 @@ const INOTIFY_EVENT_SIZE: usize = mem::size_of::() + 257;
pub fn read_into_buffer(fd: RawFd, buffer: &mut [u8]) -> isize {
unsafe {
+ // Discard the unaligned portion, if any, of the supplied buffer
+ let buffer = align_buffer_mut(buffer);
+
ffi::read(
fd,
buffer.as_mut_ptr() as *mut c_void,
@@ -23,6 +26,26 @@ pub fn read_into_buffer(fd: RawFd, buffer: &mut [u8]) -> isize {
}
}
+pub fn align_buffer(buffer: &[u8]) -> &[u8] {
+ if buffer.len() >= mem::align_of::() {
+ let ptr = buffer.as_ptr();
+ let offset = ptr.align_offset(mem::align_of::());
+ &buffer[offset..]
+ } else {
+ &buffer[0..0]
+ }
+}
+
+pub fn align_buffer_mut(buffer: &mut [u8]) -> &mut [u8] {
+ if buffer.len() >= mem::align_of::() {
+ let ptr = buffer.as_mut_ptr();
+ let offset = ptr.align_offset(mem::align_of::());
+ &mut buffer[offset..]
+ } else {
+ &mut buffer[0..0]
+ }
+}
+
/// Get the inotify event buffer size
///
/// The maximum size of an inotify event and thus the buffer size to hold it
diff --git a/vendor/inotify/src/watches.rs b/vendor/inotify/src/watches.rs
index a91ba22200fa34861a9c7d25ac985a32a4602230..81ff0052958d7aefdd0ae04d275137be30335967 100644
--- a/vendor/inotify/src/watches.rs
+++ b/vendor/inotify/src/watches.rs
@@ -1,33 +1,27 @@
use std::{
- cmp::Ordering,
- ffi::CString,
hash::{
Hash,
Hasher,
},
- io,
+ cmp::Ordering,
os::raw::c_int,
- os::unix::ffi::OsStrExt,
- path::Path,
- sync::{
- Arc,
- Weak,
- },
+ sync::Weak,
};
use inotify_sys as ffi;
use crate::fd_guard::FdGuard;
+
bitflags! {
/// Describes a file system watch
///
- /// Passed to [`Watches::add`], to describe what file system events
+ /// Passed to [`Inotify::add_watch`], to describe what file system events
/// to watch for, and how to do that.
///
/// # Examples
///
- /// `WatchMask` constants can be passed to [`Watches::add`] as is. For
+ /// `WatchMask` constants can be passed to [`Inotify::add_watch`] as is. For
/// example, here's how to create a watch that triggers an event when a file
/// is accessed:
///
@@ -39,12 +33,12 @@ bitflags! {
/// #
/// # let mut inotify = Inotify::init().unwrap();
/// #
- /// # // Create a temporary file, so `Watches::add` won't return an error.
+ /// # // Create a temporary file, so `add_watch` won't return an error.
/// # use std::fs::File;
/// # File::create("/tmp/inotify-rs-test-file")
/// # .expect("Failed to create test file");
/// #
- /// inotify.watches().add("/tmp/inotify-rs-test-file", WatchMask::ACCESS)
+ /// inotify.add_watch("/tmp/inotify-rs-test-file", WatchMask::ACCESS)
/// .expect("Error adding watch");
/// ```
///
@@ -58,11 +52,11 @@ bitflags! {
/// # };
/// #
/// # let mut inotify = Inotify::init().unwrap();
- /// inotify.watches().add("/tmp/", WatchMask::CREATE | WatchMask::DELETE)
+ /// inotify.add_watch("/tmp/", WatchMask::CREATE | WatchMask::DELETE)
/// .expect("Error adding watch");
/// ```
///
- /// [`Watches::add`]: struct.Watches.html#method.add
+ /// [`Inotify::add_watch`]: struct.Inotify.html#method.add_watch
pub struct WatchMask: u32 {
/// File was accessed
///
@@ -280,193 +274,15 @@ bitflags! {
}
}
-impl WatchDescriptor {
- /// Getter method for a watcher's id.
- ///
- /// Can be used to distinguish events for files with the same name.
- pub fn get_watch_descriptor_id(&self) -> c_int {
- self.id
- }
-}
-
-/// Interface for adding and removing watches
-#[derive(Clone, Debug)]
-pub struct Watches {
- pub(crate) fd: Arc,
-}
-
-impl Watches {
- /// Init watches with an inotify file descriptor
- pub(crate) fn new(fd: Arc) -> Self {
- Watches {
- fd,
- }
- }
-
- /// Adds or updates a watch for the given path
- ///
- /// Adds a new watch or updates an existing one for the file referred to by
- /// `path`. Returns a watch descriptor that can be used to refer to this
- /// watch later.
- ///
- /// The `mask` argument defines what kind of changes the file should be
- /// watched for, and how to do that. See the documentation of [`WatchMask`]
- /// for details.
- ///
- /// If this method is used to add a new watch, a new [`WatchDescriptor`] is
- /// returned. If it is used to update an existing watch, a
- /// [`WatchDescriptor`] that equals the previously returned
- /// [`WatchDescriptor`] for that watch is returned instead.
- ///
- /// Under the hood, this method just calls [`inotify_add_watch`] and does
- /// some trivial translation between the types on the Rust side and the C
- /// side.
- ///
- /// # Attention: Updating watches and hardlinks
- ///
- /// As mentioned above, this method can be used to update an existing watch.
- /// This is usually done by calling this method with the same `path`
- /// argument that it has been called with before. But less obviously, it can
- /// also happen if the method is called with a different path that happens
- /// to link to the same inode.
- ///
- /// You can detect this by keeping track of [`WatchDescriptor`]s and the
- /// paths they have been returned for. If the same [`WatchDescriptor`] is
- /// returned for a different path (and you haven't freed the
- /// [`WatchDescriptor`] by removing the watch), you know you have two paths
- /// pointing to the same inode, being watched by the same watch.
- ///
- /// # Errors
- ///
- /// Directly returns the error from the call to
- /// [`inotify_add_watch`][`inotify_add_watch`] (translated into an
- /// `io::Error`), without adding any error conditions of
- /// its own.
- ///
- /// # Examples
- ///
- /// ```
- /// use inotify::{
- /// Inotify,
- /// WatchMask,
- /// };
- ///
- /// let mut inotify = Inotify::init()
- /// .expect("Failed to initialize an inotify instance");
- ///
- /// # // Create a temporary file, so `Watches::add` won't return an error.
- /// # use std::fs::File;
- /// # File::create("/tmp/inotify-rs-test-file")
- /// # .expect("Failed to create test file");
- /// #
- /// inotify.watches().add("/tmp/inotify-rs-test-file", WatchMask::MODIFY)
- /// .expect("Failed to add file watch");
- ///
- /// // Handle events for the file here
- /// ```
- ///
- /// [`inotify_add_watch`]: ../inotify_sys/fn.inotify_add_watch.html
- /// [`WatchMask`]: struct.WatchMask.html
- /// [`WatchDescriptor`]: struct.WatchDescriptor.html
- pub fn add