diff options
author | Sven Nierlein <sven@nierlein.org> | 2016-11-07 23:06:38 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-11-07 23:06:38 +0100 |
commit | 06fdc551958ffcce3be101fe78d78adab8d64aa4 (patch) | |
tree | dc0e3900d3f792a0048983ff5db3f00d29392327 /plugins | |
parent | 28d4812860900e3eb21c3e64ec4250fead367c1a (diff) | |
parent | 2daf38b0aa4b242df7ac7d53fcf69088f63db4da (diff) | |
download | monitoring-plugins-06fdc551958ffcce3be101fe78d78adab8d64aa4.tar.gz |
Merge pull request #1313 from waja/check_ntp_time_remove_unused_variables
check_ntp_time: remove unused variables
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/check_ntp_time.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/plugins/check_ntp_time.c b/plugins/check_ntp_time.c index 295f86f6..1cc8cbfb 100644 --- a/plugins/check_ntp_time.c +++ b/plugins/check_ntp_time.c @@ -244,7 +244,7 @@ void setup_request(ntp_message *p){ * this is done by filtering servers based on stratum, dispersion, and * finally round-trip delay. */ int best_offset_server(const ntp_server_results *slist, int nservers){ - int i=0, cserver=0, best_server=-1; + int cserver=0, best_server=-1; /* for each server */ for(cserver=0; cserver<nservers; cserver++){ @@ -303,7 +303,7 @@ int best_offset_server(const ntp_server_results *slist, int nservers){ * we have to do it in a way that our lazy macros don't handle currently :( */ double offset_request(const char *host, int *status){ int i=0, j=0, ga_result=0, num_hosts=0, *socklist=NULL, respnum=0; - int servers_completed=0, one_written=0, one_read=0, servers_readable=0, best_index=-1; + int servers_completed=0, one_read=0, servers_readable=0, best_index=-1; time_t now_time=0, start_ts=0; ntp_message *req=NULL; double avg_offset=0.; @@ -368,7 +368,6 @@ double offset_request(const char *host, int *status){ * been touched in the past second or so and is still lacking * some responses. For each of these servers, send a new request, * and update the "waiting" timestamp with the current time. */ - one_written=0; now_time=time(NULL); for(i=0; i<num_hosts; i++){ @@ -378,7 +377,6 @@ double offset_request(const char *host, int *status){ setup_request(&req[i]); write(socklist[i], &req[i], sizeof(ntp_message)); servers[i].waiting=now_time; - one_written=1; break; } } |