summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/tail.c2
-rwxr-xr-xtests/tail-2/pid4
2 files changed, 5 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);
diff --git a/tests/tail-2/pid b/tests/tail-2/pid
index 446c6dbe3..b290f012c 100755
--- a/tests/tail-2/pid
+++ b/tests/tail-2/pid
@@ -70,4 +70,8 @@ fi
getlimits_
tail --pid=$INT_MAX -f /dev/null || fail=1
+# Ensure fractional sleep parameter is honored with --pid
+timeout 1 tail -s.1 -f /dev/null --pid=$PID_T_MAX
+test $? = 124 && fail=1
+
Exit $fail