coreutils icon indicating copy to clipboard operation
coreutils copied to clipboard

tail: handle events after tailed and before watcher starts watching

Open niyaznigmatullin opened this issue 2 years ago • 1 comments

When --follow=name read again all the files after watcher has been set up, if file changed just before the watcher started watching and after tail has happened.

This is done only when not using polling.

Tested with this sleep: sleep after all the files tailed and before watcher has been set up. For instance F-headers.sh didn't work without the fix if this line added, but starts working after the fix.

fn follow(files: &mut FileHandling, settings: &mut Settings) -> UResult<()> {
+    thread::sleep(Duration::from_millis(4000));
    let mut process = platform::ProcessChecker::new(settings.pid);

Probably fixes #3765 even without changing the testcase.

niyaznigmatullin avatar Aug 06 '22 20:08 niyaznigmatullin

@jhscheer, I'm interested in your thoughts on that

niyaznigmatullin avatar Aug 06 '22 20:08 niyaznigmatullin