diff --git a/src/uu/tail/src/tail.rs b/src/uu/tail/src/tail.rs index bc02fe41f..486a7c127 100644 --- a/src/uu/tail/src/tail.rs +++ b/src/uu/tail/src/tail.rs @@ -853,21 +853,20 @@ fn start_watcher_thread(settings: &mut Settings) -> Result; - let watcher_config = notify::poll::PollWatcherConfig { - poll_interval: settings.sleep_sec, + let watcher_config = notify::Config::default() + .with_poll_interval(settings.sleep_sec) /* NOTE: By enabling compare_contents, performance will be significantly impacted 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" */ - compare_contents: true, - }; + .with_compare_contents(true); if settings.use_polling || RecommendedWatcher::kind() == WatcherKind::PollWatcher { 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 { let tx_clone = tx.clone(); - match notify::RecommendedWatcher::new(tx) { + match notify::RecommendedWatcher::new(tx, notify::Config::default()) { Ok(w) => watcher = Box::new(w), Err(e) if e.to_string().starts_with("Too many open files") => { /* @@ -882,8 +881,7 @@ fn start_watcher_thread(settings: &mut Settings) -> Result return Err(USimpleError::new(1, e.to_string())), };