summaryrefslogtreecommitdiffstats
path: root/web/attachments/260847-check_ntp_time.best_offset_server_fix.patch
blob: c542da029073acb3e4078793b75df39eec739b9a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
Index: plugins/check_ntp_time.c
===================================================================
--- plugins/check_ntp_time.c	(revision 1885)
+++ plugins/check_ntp_time.c	(working copy)
@@ -274,7 +274,7 @@
 		/* if we haven't reached the current list's end, move everyone
 		 * over one to the right, and insert the new candidate */
 		if(i<csize){
-			for(j=5; j>i; j--){
+			for(j=4; j>i; j--){
 				candidates[j]=candidates[j-1];
 			}
 		}
@@ -337,6 +337,7 @@
 	servers=(ntp_server_results*)malloc(sizeof(ntp_server_results)*num_hosts);
 	if(servers==NULL) die(STATE_UNKNOWN, "can not allocate server array");
 	memset(servers, 0, sizeof(ntp_server_results)*num_hosts);
+	DBG(printf("Found %d peers to check\n", num_hosts));
 
 	/* setup each socket for writing, and the corresponding struct pollfd */
 	ai_tmp=ai;