timedated: be more tolerant in parsing /etc/adjtime
authorMartin Pitt <martin.pitt@ubuntu.com>
Fri, 26 Feb 2016 14:54:05 +0000 (15:54 +0100)
committerMartin Pitt <martin.pitt@ubuntu.com>
Fri, 26 Feb 2016 15:03:26 +0000 (16:03 +0100)
commitc9410dd47f4e9ba204f489dc9812a19617af020f
tree3036d950f33400d826d9c9e5347fdc4286396bcb
parent35f7216f968047be26a922dc09ca588ebca71bb0
timedated: be more tolerant in parsing /etc/adjtime

Similarly to the previous commit, make context_write_data_local_rtc()
understand /etc/adjtime files with just one or two lines, with or without a
final newline.

Normalize the file to the current definition in hwclock(8), in the spirit of
"be liberal what you accept and strict what you produce": Add line terminators,
and set the second line to "0" if missing.

Fixes: #2638
src/timedate/timedated.c