--- gvpe/src/iom.C 2004/12/15 02:59:54 1.26 +++ gvpe/src/iom.C 2005/02/14 20:51:14 1.29 @@ -35,7 +35,7 @@ // for IOM_SIG #if IOM_SIG -# include +# include # include #endif @@ -382,7 +382,17 @@ # endif # if IOM_TIME - set_now (); + { + // update time, try to compensate for gross non-monotonic time changes + tstamp diff = NOW; + set_now (); + diff = NOW - diff; + + if (diff < 0) + for (io_manager_vec::const_iterator i = tw.end (); i-- > tw.begin (); ) + if (*i) + (*i)->at += diff; + } # endif if (fds > 0) @@ -416,13 +426,14 @@ iow.erase_unordered (i); else { - short revents = iow[i]->events; + io_watcher &w = *iow[i]; + short revents = w.events; - if (!FD_ISSET (iow[i]->fd, &rfd)) revents &= ~EVENT_READ; - if (!FD_ISSET (iow[i]->fd, &wfd)) revents &= ~EVENT_WRITE; + if (!FD_ISSET (w.fd, &rfd)) revents &= ~EVENT_READ; + if (!FD_ISSET (w.fd, &wfd)) revents &= ~EVENT_WRITE; if (revents) - iow[i]->call (*iow[i], revents); + w.call (w, revents); } #endif }