From 6369641d6f594557114b78fe740544ecf69a6d37 Mon Sep 17 00:00:00 2001 From: Martin Pitt Date: Fri, 26 Feb 2016 11:25:22 +0100 Subject: clock-util: make clock_is_localtime() testable and add initial tests Add path argument to clock_is_localtime() and default to "/etc/adjtime" if it's NULL. This makes the function testable. Add test-clock: initial test cases for some scenarios, using a temporary file. This also checks the behaviour with a NULL (i. e. the system's /etc/adjtime) file. --- src/timesync/timesyncd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/timesync') diff --git a/src/timesync/timesyncd.c b/src/timesync/timesyncd.c index 23e19159e0..b67d672a6a 100644 --- a/src/timesync/timesyncd.c +++ b/src/timesync/timesyncd.c @@ -122,7 +122,7 @@ int main(int argc, char *argv[]) { goto finish; } - if (clock_is_localtime() > 0) { + if (clock_is_localtime(NULL) > 0) { log_info("The system is configured to read the RTC time in the local time zone. " "This mode can not be fully supported. All system time to RTC updates are disabled."); m->rtc_local_time = true; -- cgit v1.2.3-54-g00ecf