Advertisement
Guest User

Untitled

a guest
Aug 20th, 2016
262
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 0.53 KB | None | 0 0
  1. diff --git a/src/service.c b/src/service.c
  2. index 1898aee..3f74339 100644
  3. --- a/src/service.c
  4. +++ b/src/service.c
  5. @@ -821,9 +828,21 @@ service_find_instance
  6.      }
  7.  
  8.    /* Forced */
  9. -  TAILQ_FOREACH(si, sil, si_link)
  10. -    if(si->si_weight < 0 && si->si_error == 0)
  11. -      break;
  12. +  si = NULL;
  13. +  TAILQ_FOREACH(next, sil, si_link)
  14. +    if(next->si_weight < 0 && next->si_error == 0) {
  15. +      if(si == NULL) {
  16. +        si = next;
  17. +      } else {
  18. +        if (next->si_prio > si->si_prio)
  19. +          si = next;
  20. +      }
  21. +    }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement