summaryrefslogtreecommitdiff
path: root/src/timedate
diff options
context:
space:
mode:
authorMartin Pitt <martin.pitt@ubuntu.com>2016-02-26 11:25:22 +0100
committerMartin Pitt <martin.pitt@ubuntu.com>2016-02-26 11:28:49 +0100
commit6369641d6f594557114b78fe740544ecf69a6d37 (patch)
tree9970181e381ca65c923bec9ef8ab711b705eb397 /src/timedate
parent06fb28b16eb4b6170c2e2c0cf1f673730309509b (diff)
downloadsystemd-6369641d6f594557114b78fe740544ecf69a6d37.tar.gz
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.
Diffstat (limited to 'src/timedate')
-rw-r--r--src/timedate/timedated.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/timedate/timedated.c b/src/timedate/timedated.c
index 2a10135fba..55c24ac4f0 100644
--- a/src/timedate/timedated.c
+++ b/src/timedate/timedated.c
@@ -78,7 +78,7 @@ static int context_read_data(Context *c) {
c->zone = t;
t = NULL;
- c->local_rtc = clock_is_localtime() > 0;
+ c->local_rtc = clock_is_localtime(NULL) > 0;
return 0;
}