]> git.ipfire.org Git - thirdparty/chrony.git/commitdiff
rtc: don't try to open rtcfile when not set
authorMiroslav Lichvar <mlichvar@redhat.com>
Mon, 18 Aug 2014 15:34:25 +0000 (17:34 +0200)
committerMiroslav Lichvar <mlichvar@redhat.com>
Tue, 19 Aug 2014 08:46:35 +0000 (10:46 +0200)
rtc_linux.c

index c45ae2b640024cf5beffdc522533fbdb581c9983..0b2b0d07cb804011383634b0d8f38d06401082c7 100644 (file)
@@ -438,8 +438,7 @@ read_coefs_from_file(void)
 
     tried_to_load_coefs = 1;
 
-    in = fopen(coefs_file_name, "r");
-    if (in) {
+    if (coefs_file_name && (in = fopen(coefs_file_name, "r"))) {
       if (fscanf(in, "%d%ld%lf%lf",
                  &valid_coefs_from_file,
                  &file_ref_time,