]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
Don't update empty sourcestats on clock update
authorMiroslav Lichvar <mlichvar@redhat.com>
Tue, 5 Apr 2011 14:32:50 +0000 (16:32 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 5 Apr 2011 14:32:50 +0000 (16:32 +0200)
sourcestats.c

index 7a7d3e80b837757da9fff420f7406060058a66b4..ec34b8db3ca5503a742b41573f1f717fc028ca90 100644 (file)
@@ -619,6 +619,9 @@ SST_SlewSamples(SST_Stats inst, struct timeval *when, double dfreq, double doffs
   struct timeval *sample, prev;
   double prev_offset, prev_freq;
 
+  if (!inst->n_samples)
+    return;
+
   for (m = -inst->runs_samples; m < inst->n_samples; m++) {
     i = get_runsbuf_index(inst, m);
     sample = &(inst->sample_times[i]);