summaryrefslogtreecommitdiff
path: root/src/tail.c
diff options
context:
space:
mode:
authorPádraig Brady <P@draigBrady.com>2009-07-30 15:29:13 +0100
committerJim Meyering <meyering@redhat.com>2009-07-30 17:40:43 +0200
commitc9871986eb4c6d526a1f4d92a8280b6e54bf07df (patch)
tree37b37d66a4931a93c7758b64a955723b47b516ff /src/tail.c
parent2ac2cace153dd19aaff5d3e0e6ce68d03146ca92 (diff)
downloadcoreutils-c9871986eb4c6d526a1f4d92a8280b6e54bf07df.tar.xz
tail: properly parse fractional seconds when monitoring a pid
* src/tail.c (tail_forever_inotify): The fractional part of the delay was 1000 times too large. * tests/tail-2/pid: Add a test to ensure the timeout happens for this case.
Diffstat (limited to 'src/tail.c')
-rw-r--r--src/tail.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/tail.c b/src/tail.c
index 5efaf57d9..8aa31d557 100644
--- a/src/tail.c
+++ b/src/tail.c
@@ -1268,7 +1268,7 @@ tail_forever_inotify (int wd, struct File_spec *f, size_t n_files,
FD_SET (wd, &rfd);
select_timeout.tv_sec = (time_t) sleep_interval;
- select_timeout.tv_usec = 1000000000 * (sleep_interval
+ select_timeout.tv_usec = 1000000 * (sleep_interval
- select_timeout.tv_sec);
n_descriptors = select (wd + 1, &rfd, NULL, NULL, &select_timeout);