if (form->timer) {
/* Calculate when we next need to return with a timeout. Do
this inside the loop in case a callback resets the timer. */
- if (!form->lastTimeout.tv_sec && !form->lastTimeout.tv_usec)
- gettimeofday(&form->lastTimeout, NULL);
+ gettimeofday(&now, 0);
+
+ if ((!form->lastTimeout.tv_sec && !form->lastTimeout.tv_usec) ||
+ now.tv_sec < form->lastTimeout.tv_sec ||
+ (now.tv_sec == form->lastTimeout.tv_sec &&
+ now.tv_usec < form->lastTimeout.tv_usec))
+ form->lastTimeout = now;
nextTimeout.tv_sec = form->lastTimeout.tv_sec +
(form->timer / 1000);
nextTimeout.tv_usec = form->lastTimeout.tv_usec +
(form->timer % 1000) * 1000;
- gettimeofday(&now, 0);
-
if (now.tv_sec > nextTimeout.tv_sec) {
timeout.tv_sec = timeout.tv_usec = 0;
} else if (now.tv_sec == nextTimeout.tv_sec) {
%{_libdir}/libnewt.a
%changelog
+- cope with backward system time jumps (#240691)
- free helplines and windows in newtFinished, check for overflow (#239992)
- add release to -devel and -static requires (#238784)
- fix cursor positioning when setting entry or checkbox flags