diff --git a/src/backend.c b/src/backend.c index 0dd97402caf0ec3b4113e4c6aec759fca9da6e0a..88cd20126c37a1d0a609c490642a8aee21acd363 100644 --- a/src/backend.c +++ b/src/backend.c @@ -191,11 +191,7 @@ void backend() while(first_object) { next_timeout.tv_usec = 0; -#if 0 next_timeout.tv_sec = 7 * 24 * 60 * 60; /* See you in a week */ -#else - next_timeout.tv_sec = 15; /* See you in a week */ -#endif my_add_timeval(&next_timeout, ¤t_time); call_callback(& backend_callbacks, (void *)0); @@ -207,10 +203,11 @@ void backend() #endif GETTIMEOFDAY(¤t_time); - my_subtract_timeval(&next_timeout, ¤t_time); - if(next_timeout.tv_sec < 0) + if(my_timercmp(&next_timeout, > , ¤t_time)) { + my_subtract_timeval(&next_timeout, ¤t_time); + }else{ next_timeout.tv_usec = 0; next_timeout.tv_sec = 0; }