aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorcbdev <cb@cbcdn.com>2018-03-25 15:13:23 +0200
committercbdev <cb@cbcdn.com>2018-03-25 15:13:23 +0200
commit323db724551f2e1908aa0341a5d2b6e03ce351ae (patch)
tree791d182966a17a742344738bd68396268aff4bb2
parent9a70fb468c78706cabf62ede9b5a67b822129d91 (diff)
downloadmidimonster-323db724551f2e1908aa0341a5d2b6e03ce351ae.tar.gz
midimonster-323db724551f2e1908aa0341a5d2b6e03ce351ae.tar.bz2
midimonster-323db724551f2e1908aa0341a5d2b6e03ce351ae.zip
Actually fix interval calculation (Fixes #7)
-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;
}
}