[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Bug#545422: coreutils: "tail -f -" fails

From: Paul Eggert
Subject: Re: Bug#545422: coreutils: "tail -f -" fails
Date: Tue, 22 Sep 2009 16:33:15 -0700
User-agent: Gnus/5.11 (Gnus v5.11) Emacs/22.2 (gnu/linux)

Giuseppe Scrivano <address@hidden> writes:

> In my opinion, it is desiderable that tail works approximately in the
> same way when stdin is specified,

Assuming that the extension you proposed in
<http://www.mail-archive.com/address@hidden/msg17684.html> is
added to the Linux kernel, I suggest that coreutils modify the code to
use 'inotify_add_watch_fd' instead of the current 'inotify_add_watch'.
This will let "tail" watch stdin just like it can watch any other file

An added benefit of the fd approach is that it will fix a race
condition in the current code, if a file is renamed between the call
to 'open' and the call to 'inotify_add_watch_fd'.

It should also simplify the "tail" code considerably to use an
file-descriptor-based approach.

In the meantime I would just leave the code alone; no sense wasting
much time maintaining the inferior kernel interface.

reply via email to

[Prev in Thread] Current Thread [Next in Thread]