mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-07-29 12:07:46 +00:00
Merge pull request #3823 from niyaznigmatullin/update-notify-5.0.0-pre.16
Update notify 5.0.0 pre.16
This commit is contained in:
commit
68aec6685e
3 changed files with 9 additions and 11 deletions
4
Cargo.lock
generated
4
Cargo.lock
generated
|
@ -1201,9 +1201,9 @@ dependencies = [
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "notify"
|
name = "notify"
|
||||||
version = "5.0.0-pre.15"
|
version = "5.0.0-pre.16"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "553f9844ad0b0824605c20fb55a661679782680410abfb1a8144c2e7e437e7a7"
|
checksum = "530f6314d6904508082f4ea424a0275cf62d341e118b313663f266429cb19693"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"crossbeam-channel",
|
"crossbeam-channel",
|
||||||
|
|
|
@ -18,7 +18,7 @@ path = "src/tail.rs"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clap = { version = "3.2", features = ["wrap_help", "cargo"] }
|
clap = { version = "3.2", features = ["wrap_help", "cargo"] }
|
||||||
libc = "0.2.126"
|
libc = "0.2.126"
|
||||||
notify = { version = "=5.0.0-pre.15", features=["macos_kqueue"]}
|
notify = { version = "=5.0.0-pre.16", features=["macos_kqueue"]}
|
||||||
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["ringbuffer", "lines"] }
|
uucore = { version=">=0.0.11", package="uucore", path="../../uucore", features=["ringbuffer", "lines"] }
|
||||||
|
|
||||||
[target.'cfg(windows)'.dependencies]
|
[target.'cfg(windows)'.dependencies]
|
||||||
|
|
|
@ -853,21 +853,20 @@ fn start_watcher_thread(settings: &mut Settings) -> Result<WatcherRx, Box<(dyn U
|
||||||
*/
|
*/
|
||||||
|
|
||||||
let watcher: Box<dyn Watcher>;
|
let watcher: Box<dyn Watcher>;
|
||||||
let watcher_config = notify::poll::PollWatcherConfig {
|
let watcher_config = notify::Config::default()
|
||||||
poll_interval: settings.sleep_sec,
|
.with_poll_interval(settings.sleep_sec)
|
||||||
/*
|
/*
|
||||||
NOTE: By enabling compare_contents, performance will be significantly impacted
|
NOTE: By enabling compare_contents, performance will be significantly impacted
|
||||||
as all files will need to be read and hashed at each `poll_interval`.
|
as all files will need to be read and hashed at each `poll_interval`.
|
||||||
However, this is necessary to pass: "gnu/tests/tail-2/F-vs-rename.sh"
|
However, this is necessary to pass: "gnu/tests/tail-2/F-vs-rename.sh"
|
||||||
*/
|
*/
|
||||||
compare_contents: true,
|
.with_compare_contents(true);
|
||||||
};
|
|
||||||
if settings.use_polling || RecommendedWatcher::kind() == WatcherKind::PollWatcher {
|
if settings.use_polling || RecommendedWatcher::kind() == WatcherKind::PollWatcher {
|
||||||
settings.use_polling = true; // We have to use polling because there's no supported backend
|
settings.use_polling = true; // We have to use polling because there's no supported backend
|
||||||
watcher = Box::new(notify::PollWatcher::with_config(tx, watcher_config).unwrap());
|
watcher = Box::new(notify::PollWatcher::new(tx, watcher_config).unwrap());
|
||||||
} else {
|
} else {
|
||||||
let tx_clone = tx.clone();
|
let tx_clone = tx.clone();
|
||||||
match notify::RecommendedWatcher::new(tx) {
|
match notify::RecommendedWatcher::new(tx, notify::Config::default()) {
|
||||||
Ok(w) => watcher = Box::new(w),
|
Ok(w) => watcher = Box::new(w),
|
||||||
Err(e) if e.to_string().starts_with("Too many open files") => {
|
Err(e) if e.to_string().starts_with("Too many open files") => {
|
||||||
/*
|
/*
|
||||||
|
@ -882,8 +881,7 @@ fn start_watcher_thread(settings: &mut Settings) -> Result<WatcherRx, Box<(dyn U
|
||||||
);
|
);
|
||||||
set_exit_code(1);
|
set_exit_code(1);
|
||||||
settings.use_polling = true;
|
settings.use_polling = true;
|
||||||
watcher =
|
watcher = Box::new(notify::PollWatcher::new(tx_clone, watcher_config).unwrap());
|
||||||
Box::new(notify::PollWatcher::with_config(tx_clone, watcher_config).unwrap());
|
|
||||||
}
|
}
|
||||||
Err(e) => return Err(USimpleError::new(1, e.to_string())),
|
Err(e) => return Err(USimpleError::new(1, e.to_string())),
|
||||||
};
|
};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue