[monitoring-plugins] check_ntp: remove unused variables

Jan Wagner <[email protected]> Mon, 7 Nov 2016 23:10:12 +0100 (CET)
Newsgroups gmane.network.nagios.cvs
Message-ID <20161107221012.2D8F22008467__48839.3286047087$1478556654$gmane$org@orwell.monitoring-plugins.org>
    Module: monitoring-plugins
    Branch: master
    Commit: fec3e01f89715987da6c03c7af9fa6626f773c01
    Author: Sebastian Herbszt <[email protected]>
 Committer: Jan Wagner <[email protected]>
      Date: Sat Dec 20 20:56:07 2014 +0100
       URL: https://www.monitoring-plugins.org/repositories/monitoring-plugins/commit/?id=fec3e01

check_ntp: remove unused variables

Remove unused variables.

Signed-off-by: Sebastian Herbszt <[email protected]>

---

 plugins/check_ntp.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/plugins/check_ntp.c b/plugins/check_ntp.c
index a7d278d..7450171 100644
--- a/plugins/check_ntp.c
+++ b/plugins/check_ntp.c
@@ -297,7 +297,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++){
@@ -356,7 +356,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.;
@@ -421,7 +421,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++){
@@ -431,7 +430,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;
 			}
 		}
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.