]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
sourcestats: remove warning messages from SST_LoadFromFile()
authorMiroslav Lichvar <mlichvar@redhat.com>
Fri, 19 Aug 2016 15:53:08 +0000 (17:53 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Mon, 22 Aug 2016 13:05:48 +0000 (15:05 +0200)
There is a generic error message in SRC_ReloadSources().

sourcestats.c

index 7d3fd0f9244c9cbd812d93805612134790e894b6..82fc5f5eb81e43f7ee1a309adbf6c67551536510 100644 (file)
@@ -858,7 +858,7 @@ SST_LoadFromFile(SST_Stats inst, FILE *in)
   unsigned long sec;
 #endif
   unsigned long usec;
-  int i, line_number;
+  int i;
   char line[1024];
   double weight;
 
@@ -868,8 +868,6 @@ SST_LoadFromFile(SST_Stats inst, FILE *in)
       sscanf(line, "%d", &inst->n_samples) == 1 &&
       inst->n_samples > 0 && inst->n_samples <= MAX_SAMPLES) {
 
-    line_number = 2;
-
     for (i=0; i<inst->n_samples; i++) {
       if (!fgets(line, sizeof(line), in) ||
           (sscanf(line,
@@ -890,7 +888,6 @@ SST_LoadFromFile(SST_Stats inst, FILE *in)
 
         /* This is the branch taken if the read FAILED */
 
-        LOG(LOGS_WARN, LOGF_SourceStats, "Failed to read data from line %d of dump file", line_number);
         inst->n_samples = 0; /* Load abandoned if any sign of corruption */
         return 0;
       } else {
@@ -899,12 +896,9 @@ SST_LoadFromFile(SST_Stats inst, FILE *in)
         inst->sample_times[i].tv_sec = sec;
         inst->sample_times[i].tv_nsec = 1000 * usec;
         UTI_NormaliseTimespec(&inst->sample_times[i]);
-
-        line_number++;
       }
     }
   } else {
-    LOG(LOGS_WARN, LOGF_SourceStats, "Could not read number of samples from dump file");
     inst->n_samples = 0; /* Load abandoned if any sign of corruption */
     return 0;
   }