From: Miroslav Lichvar Date: Mon, 18 Aug 2014 15:34:25 +0000 (+0200) Subject: rtc: don't try to open rtcfile when not set X-Git-Tag: 1.31-pre1~12 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e0af8069c12f61e794e6d9a0ee089073e62869fe;p=thirdparty%2Fchrony.git rtc: don't try to open rtcfile when not set --- diff --git a/rtc_linux.c b/rtc_linux.c index c45ae2b6..0b2b0d07 100644 --- a/rtc_linux.c +++ b/rtc_linux.c @@ -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,