diff options
Diffstat (limited to 'plugins/check_ntp.c')
-rw-r--r-- | plugins/check_ntp.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c index 914b40c..8b776ba 100644 --- a/plugins/check_ntp.c +++ b/plugins/check_ntp.c | |||
@@ -355,7 +355,7 @@ int best_offset_server(const ntp_server_results *slist, int nservers){ | |||
355 | * - we also "manually" handle resolving host names and connecting, because | 355 | * - we also "manually" handle resolving host names and connecting, because |
356 | * we have to do it in a way that our lazy macros don't handle currently :( */ | 356 | * we have to do it in a way that our lazy macros don't handle currently :( */ |
357 | double offset_request(const char *host, int *status){ | 357 | double offset_request(const char *host, int *status){ |
358 | int i=0, j=0, ga_result=0, num_hosts=0, *socklist=NULL, respnum=0; | 358 | int i=0, ga_result=0, num_hosts=0, *socklist=NULL, respnum=0; |
359 | int servers_completed=0, one_read=0, servers_readable=0, best_index=-1; | 359 | int servers_completed=0, one_read=0, servers_readable=0, best_index=-1; |
360 | time_t now_time=0, start_ts=0; | 360 | time_t now_time=0, start_ts=0; |
361 | ntp_message *req=NULL; | 361 | ntp_message *req=NULL; |
@@ -488,7 +488,7 @@ double offset_request(const char *host, int *status){ | |||
488 | /* cleanup */ | 488 | /* cleanup */ |
489 | /* FIXME: Not closing the socket to avoid re-use of the local port | 489 | /* FIXME: Not closing the socket to avoid re-use of the local port |
490 | * which can cause old NTP packets to be read instead of NTP control | 490 | * which can cause old NTP packets to be read instead of NTP control |
491 | * pactets in jitter_request(). THERE MUST BE ANOTHER WAY... | 491 | * packets in jitter_request(). THERE MUST BE ANOTHER WAY... |
492 | * for(j=0; j<num_hosts; j++){ close(socklist[j]); } */ | 492 | * for(j=0; j<num_hosts; j++){ close(socklist[j]); } */ |
493 | free(socklist); | 493 | free(socklist); |
494 | free(ufds); | 494 | free(ufds); |
@@ -512,7 +512,7 @@ setup_control_request(ntp_control_message *p, uint8_t opcode, uint16_t seq){ | |||
512 | } | 512 | } |
513 | 513 | ||
514 | /* XXX handle responses with the error bit set */ | 514 | /* XXX handle responses with the error bit set */ |
515 | double jitter_request(const char *host, int *status){ | 515 | double jitter_request(int *status){ |
516 | int conn=-1, i, npeers=0, num_candidates=0, syncsource_found=0; | 516 | int conn=-1, i, npeers=0, num_candidates=0, syncsource_found=0; |
517 | int run=0, min_peer_sel=PEER_INCLUDED, num_selected=0, num_valid=0; | 517 | int run=0, min_peer_sel=PEER_INCLUDED, num_selected=0, num_valid=0; |
518 | int peers_size=0, peer_offset=0; | 518 | int peers_size=0, peer_offset=0; |
@@ -803,7 +803,7 @@ int main(int argc, char *argv[]){ | |||
803 | * (for example) will result in an error | 803 | * (for example) will result in an error |
804 | */ | 804 | */ |
805 | if(do_jitter){ | 805 | if(do_jitter){ |
806 | jitter=jitter_request(server_address, &jitter_result); | 806 | jitter=jitter_request(&jitter_result); |
807 | result = max_state_alt(result, get_status(jitter, jitter_thresholds)); | 807 | result = max_state_alt(result, get_status(jitter, jitter_thresholds)); |
808 | /* -1 indicates that we couldn't calculate the jitter | 808 | /* -1 indicates that we couldn't calculate the jitter |
809 | * Only overrides STATE_OK from the offset */ | 809 | * Only overrides STATE_OK from the offset */ |