[dovecot-cvs] dovecot/src/lib ioloop.c,1.35.2.3,1.35.2.4

tss at dovecot.org tss at dovecot.org
Wed Feb 28 20:19:41 UTC 2007


Update of /var/lib/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv14801

Modified Files:
      Tag: branch_1_0
	ioloop.c 
Log Message:
If time moves backwards, kill ourself.



Index: ioloop.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib/ioloop.c,v
retrieving revision 1.35.2.3
retrieving revision 1.35.2.4
diff -u -d -r1.35.2.3 -r1.35.2.4
--- ioloop.c	15 Feb 2007 13:57:04 -0000	1.35.2.3
+++ ioloop.c	28 Feb 2007 20:19:39 -0000	1.35.2.4
@@ -216,6 +216,14 @@
 
 	if (gettimeofday(&ioloop_timeval, &ioloop_timezone) < 0)
 		i_fatal("gettimeofday(): %m");
+
+	if (ioloop_time > ioloop_timeval.tv_sec) {
+		i_fatal("Time just moved backwards (%s -> %s)! "
+			"This might cause a lot of problems, "
+			"so I'll just kill myself now.",
+			dec2str(ioloop_time), dec2str(ioloop_timeval.tv_sec));
+	}
+
 	ioloop_time = ioloop_timeval.tv_sec;
 
 	if (ioloop->timeouts == NULL || !ioloop->timeouts->run_now)



More information about the dovecot-cvs mailing list