summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ev.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/ev.c b/ev.c
index e5992c3..255a9cd 100644
--- a/ev.c
+++ b/ev.c
@@ -1767,6 +1767,9 @@ ev_embed_stop (EV_P_ ev_embed *w)
# define lstat(a,b) stat(a,b)
# endif
+#define DEF_STAT_INTERVAL 5.0074891
+#define MIN_STAT_INTERVAL 0.1074891
+
void
ev_stat_stat (EV_P_ ev_stat *w)
{
@@ -1802,6 +1805,9 @@ ev_stat_start (EV_P_ ev_stat *w)
ev_stat_stat (EV_A_ w);
+ if (w->interval < MIN_STAT_INTERVAL)
+ w->interval = w->interval ? MIN_STAT_INTERVAL : DEF_STAT_INTERVAL;
+
ev_timer_init (&w->timer, stat_timer_cb, w->interval, w->interval);
ev_set_priority (&w->timer, ev_priority (w));
ev_timer_start (EV_A_ &w->timer);