diff options
author | Pádraig Brady <P@draigBrady.com> | 2009-10-01 08:36:25 +0100 |
---|---|---|
committer | Pádraig Brady <P@draigBrady.com> | 2009-10-02 14:00:06 +0100 |
commit | f8726e05c4ec1141fb3ffad1c9ec3838f59182cb (patch) | |
tree | 7153d27a45fb3d26b186473daf8443fc4654f377 /tests/misc/df | |
parent | 95c01c656e061bccbab41fa651c99cb7041c9937 (diff) | |
download | coreutils-f8726e05c4ec1141fb3ffad1c9ec3838f59182cb.tar.xz |
tail: avoid a race where we could miss new data with --pid
* src/tail.c (tail_forever, tail_forever_inotify): Close a race in
tail_forever_inotify where new data written after the file check by
a now dead process, but before the pid check, is not output. We use
the POSIX guarantee that read() and write() are serialized wrt each
other even in separate processes, to assume full file consistency
after exit() and so poll for new data _after_ the writer has exited.
This also allows us to not redundantly _wait_ for new data if the
process is dead.
* tests/tail-2/pid: Remove the now partially invalid sub second sleep
check as we now don't unconditionally wait, and replace it with a check
for the redundant sleep. Also clarify some of the existing comments.
* NEWS: Mention the fix.
Diffstat (limited to 'tests/misc/df')
0 files changed, 0 insertions, 0 deletions