aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--pw.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/pw.c b/pw.c
index 7f98136..44d0faa 100644
--- a/pw.c
+++ b/pw.c
@@ -1571,7 +1571,9 @@ int main(int argc, char **argv)
gettimeofday(&tv, NULL);
now = tv.tv_sec % 1000000 * 1000 + tv.tv_usec / 1000;
- if (lasttime == -1 || now - lasttime > long_interval) {
+ if (lasttime == -1 ||
+ (now + 1000000000 - lasttime) % 1000000000 > long_interval)
+ {
if ((pw.stat & stat_dirty) && pw.nlines == pw.maxlines)
force = 1;
lasttime = now;