--- rxvt-unicode/src/iom.C 2004/12/20 16:44:31 1.27 +++ rxvt-unicode/src/iom.C 2006/01/11 21:23:39 1.31 @@ -1,8 +1,10 @@ /* iom.C -- generic I/O multiplexer - Copyright (C) 2003, 2004 Marc Lehmann + Copyright (C) 2003, 2004 Marc Lehmann - This program is free software; you can redistribute it and/or modify + This file is part of GVPE. + + GVPE is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version. @@ -13,8 +15,8 @@ GNU General Public License for more details. You should have received a copy of the GNU General Public License - along with this program; if not, write to the Free Software - Foundation, Inc. 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + along with gvpe; if not, write to the Free Software + Foundation, Inc. 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA */ #include "iom.h" @@ -43,9 +45,6 @@ // until that happens, sys/select.h must come last #include -// TSTAMP_MAX must still fit into a positive struct timeval -#define TSTAMP_MAX (double)(1UL<<31) - #define TIMEVAL timeval #define TV_FRAC tv_usec #define TV_MULT 1000000L @@ -138,6 +137,11 @@ #endif } + ~init () + { + iom_valid = false; + } + static void required (); } init; @@ -382,7 +386,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)