summaryrefslogtreecommitdiff
path: root/ev.c
diff options
context:
space:
mode:
authorroot <root>2007-11-27 07:27:10 +0000
committerroot <root>2007-11-27 07:27:10 +0000
commit9c468d0cd3a409a8c4b1b37d6e161404350d67cb (patch)
treec00d08dda9a896f7d85e244152b49bb32f1814e1 /ev.c
parentb57eb07483ea889f20500834cba164374cdec35b (diff)
*** empty log message ***
Diffstat (limited to 'ev.c')
-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);