aboutsummaryrefslogtreecommitdiffhomepage
path: root/backend.c
diff options
context:
space:
mode:
Diffstat (limited to 'backend.c')
-rw-r--r--backend.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/backend.c b/backend.c
index 38abc7f..881f9b7 100644
--- a/backend.c
+++ b/backend.c
@@ -212,9 +212,11 @@ struct timeval backend_timeout(){
for(u = 0; u < nbackends; u++){
if(backends[u].interval){
res = backends[u].interval();
- if((res / 1000) <= secs){
+ if((res / 1000) < secs){
secs = res / 1000;
- if((res % 1000) < msecs){
+ msecs = res % 1000;
+ }
+ else if(res / 1000 == secs && (res % 1000) < msecs){
msecs = res % 1000;
}
}