]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
sources: don't log warning when opening dump file fails
authorMiroslav Lichvar <mlichvar@redhat.com>
Fri, 11 Nov 2016 12:32:54 +0000 (13:32 +0100)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 15 Nov 2016 13:55:25 +0000 (14:55 +0100)
Instead of complaining when the file doesn't exist, which is common when
using pool servers, log an informational message when the file is
loaded.

sources.c

index 80f72cd8cbba85c808030162a3ba6be96b749538..541dbbac31657d706b806d282be21d3ce15c1bd6 100644 (file)
--- a/sources.c
+++ b/sources.c
@@ -1192,7 +1192,7 @@ FILE *open_dumpfile(SRC_Instance inst, const char *mode)
   }
 
   f = fopen(filename, mode);
-  if (!f)
+  if (!f && mode[0] != 'r')
     LOG(LOGS_WARN, LOGF_Sources, "Could not open dump file for %s",
         source_to_string(inst));
 
@@ -1232,6 +1232,9 @@ SRC_ReloadSources(void)
     if (!SST_LoadFromFile(sources[i]->stats, in))
       LOG(LOGS_WARN, LOGF_Sources, "Could not load dump file for %s",
           source_to_string(sources[i]));
+    else
+      LOG(LOGS_INFO, LOGF_Sources, "Loaded dump file for %s",
+          source_to_string(sources[i]));
     fclose(in);
   }
 }