summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Changes3
-rw-r--r--ev.c31
2 files changed, 20 insertions, 14 deletions
diff --git a/Changes b/Changes
index 77a0350..ae3447d 100644
--- a/Changes
+++ b/Changes
@@ -18,6 +18,9 @@ TODO: somehow unblock procmask?
- changed minimum glibc requirement from glibc 2.9 to 2.7, for
signalfd.
- add missing string.h include (Denis F. Latypoff).
+ - only replace ev_stat.prev when we detect an actual difference,
+ so prev is (almost) always different to attr. this might
+ have caused the probems with 04_stat.t.
3.8 Sun Aug 9 14:30:45 CEST 2009
- incompatible change: do not necessarily reset signal handler
diff --git a/ev.c b/ev.c
index 5071b4a..aa38d1d 100644
--- a/ev.c
+++ b/ev.c
@@ -3103,25 +3103,28 @@ stat_timer_cb (EV_P_ ev_timer *w_, int revents)
{
ev_stat *w = (ev_stat *)(((char *)w_) - offsetof (ev_stat, timer));
- /* we copy this here each the time so that */
- /* prev has the old value when the callback gets invoked */
- w->prev = w->attr;
+ ev_statdata prev = w->attr;
ev_stat_stat (EV_A_ w);
/* memcmp doesn't work on netbsd, they.... do stuff to their struct stat */
if (
- w->prev.st_dev != w->attr.st_dev
- || w->prev.st_ino != w->attr.st_ino
- || w->prev.st_mode != w->attr.st_mode
- || w->prev.st_nlink != w->attr.st_nlink
- || w->prev.st_uid != w->attr.st_uid
- || w->prev.st_gid != w->attr.st_gid
- || w->prev.st_rdev != w->attr.st_rdev
- || w->prev.st_size != w->attr.st_size
- || w->prev.st_atime != w->attr.st_atime
- || w->prev.st_mtime != w->attr.st_mtime
- || w->prev.st_ctime != w->attr.st_ctime
+ prev.st_dev != w->attr.st_dev
+ || prev.st_ino != w->attr.st_ino
+ || prev.st_mode != w->attr.st_mode
+ || prev.st_nlink != w->attr.st_nlink
+ || prev.st_uid != w->attr.st_uid
+ || prev.st_gid != w->attr.st_gid
+ || prev.st_rdev != w->attr.st_rdev
+ || prev.st_size != w->attr.st_size
+ || prev.st_atime != w->attr.st_atime
+ || prev.st_mtime != w->attr.st_mtime
+ || prev.st_ctime != w->attr.st_ctime
) {
+ /* we only update w->prev on actual differences */
+ /* in case we test more often than invoke the callback, */
+ /* to ensure that prev is always different to attr */
+ w->prev = prev;
+
#if EV_USE_INOTIFY
if (fs_fd >= 0)
{