Skip to content
Snippets Groups Projects
Commit f63009ad authored by Fredrik Hübinette (Hubbe)'s avatar Fredrik Hübinette (Hubbe)
Browse files

bugfix for unsigned tv_sec

Rev: src/backend.c:1.7
parent f3248cdc
No related branches found
No related tags found
No related merge requests found
...@@ -191,11 +191,7 @@ void backend() ...@@ -191,11 +191,7 @@ void backend()
while(first_object) while(first_object)
{ {
next_timeout.tv_usec = 0; next_timeout.tv_usec = 0;
#if 0
next_timeout.tv_sec = 7 * 24 * 60 * 60; /* See you in a week */ 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, &current_time); my_add_timeval(&next_timeout, &current_time);
call_callback(& backend_callbacks, (void *)0); call_callback(& backend_callbacks, (void *)0);
...@@ -207,10 +203,11 @@ void backend() ...@@ -207,10 +203,11 @@ void backend()
#endif #endif
GETTIMEOFDAY(&current_time); GETTIMEOFDAY(&current_time);
my_subtract_timeval(&next_timeout, &current_time);
if(next_timeout.tv_sec < 0) if(my_timercmp(&next_timeout, > , &current_time))
{ {
my_subtract_timeval(&next_timeout, &current_time);
}else{
next_timeout.tv_usec = 0; next_timeout.tv_usec = 0;
next_timeout.tv_sec = 0; next_timeout.tv_sec = 0;
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment