diff options
Diffstat (limited to 'plugins/t')
0 files changed, 0 insertions, 0 deletions
diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c index 75efc28..5ac6c65 100644 --- a/plugins/check_ntp.c +++ b/plugins/check_ntp.c | |||
@@ -297,7 +297,7 @@ void setup_request(ntp_message *p){ | |||
297 | * this is done by filtering servers based on stratum, dispersion, and | 297 | * this is done by filtering servers based on stratum, dispersion, and |
298 | * finally round-trip delay. */ | 298 | * finally round-trip delay. */ |
299 | int best_offset_server(const ntp_server_results *slist, int nservers){ | 299 | int best_offset_server(const ntp_server_results *slist, int nservers){ |
300 | int i=0, cserver=0, best_server=-1; | 300 | int cserver=0, best_server=-1; |
301 | 301 | ||
302 | /* for each server */ | 302 | /* for each server */ |
303 | for(cserver=0; cserver<nservers; cserver++){ | 303 | for(cserver=0; cserver<nservers; cserver++){ |
@@ -356,7 +356,7 @@ int best_offset_server(const ntp_server_results *slist, int nservers){ | |||
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, j=0, ga_result=0, num_hosts=0, *socklist=NULL, respnum=0; |
359 | int servers_completed=0, one_written=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; |
362 | double avg_offset=0.; | 362 | double avg_offset=0.; |
@@ -421,7 +421,6 @@ double offset_request(const char *host, int *status){ | |||
421 | * been touched in the past second or so and is still lacking | 421 | * been touched in the past second or so and is still lacking |
422 | * some responses. for each of these servers, send a new request, | 422 | * some responses. for each of these servers, send a new request, |
423 | * and update the "waiting" timestamp with the current time. */ | 423 | * and update the "waiting" timestamp with the current time. */ |
424 | one_written=0; | ||
425 | now_time=time(NULL); | 424 | now_time=time(NULL); |
426 | 425 | ||
427 | for(i=0; i<num_hosts; i++){ | 426 | for(i=0; i<num_hosts; i++){ |
@@ -431,7 +430,6 @@ double offset_request(const char *host, int *status){ | |||
431 | setup_request(&req[i]); | 430 | setup_request(&req[i]); |
432 | write(socklist[i], &req[i], sizeof(ntp_message)); | 431 | write(socklist[i], &req[i], sizeof(ntp_message)); |
433 | servers[i].waiting=now_time; | 432 | servers[i].waiting=now_time; |
434 | one_written=1; | ||
435 | break; | 433 | break; |
436 | } | 434 | } |
437 | } | 435 | } |