summaryrefslogtreecommitdiff
path: root/src/basic/clock-util.c
AgeCommit message (Collapse)Author
2016-02-26clock-util: be more tolerant in parsing /etc/adjtimeMartin Pitt
As we default to "hardware clock is in UTC" if /etc/adjtime is not present, it also makes sense to have that default if /etc/adjtime contains only one or two lines. Drop the "gibberish" test case, as this was just EIO because of not containing three lines, which is already contained in other tests. clock_is_localtime() never actually validated the format of the first two lines, and there is little point in doing that. This addresses the reading half of issue #2638.
2016-02-26clock-util: make clock_is_localtime() testable and add initial testsMartin Pitt
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.
2016-02-10tree-wide: remove Emacs lines from all filesDaniel Mack
This should be handled fine now by .dir-locals.el, so need to carry that stuff in every file.
2016-02-03resolved: apply epoch to system time from PID 1Lennart Poettering
For use in timesyncd we already defined a compile-time "epoch" value, which is based on the mtime of the NEWS file, and specifies a point in time we know lies in the past at runtime. timesyncd uses this to filter out nonsensical timestamp file data, and bump the system clock to a time that is after the build time of systemd. This patch adds similar bumping code to earliest PID 1 initialization, so that the system never continues operation with a clock that is in the 1970ies or even 1930s.
2016-01-18Use negative_errno() to assert errno is positive after a few system callsZbigniew Jędrzejewski-Szmek
This is not particularly intrusive because it happens in simple utility functions. It helps gcc understand that error codes are negative. This gets a rid of most of the remaining warnings.
2015-11-30basic: include only what we useThomas Hindoe Paaboel Andersen
This is a cleaned up result of running iwyu but without forward declarations on src/basic.
2015-10-25util-lib: split out fd-related operations into fd-util.[ch]Lennart Poettering
There are more than enough to deserve their own .c file, hence move them over.
2015-10-24util-lib: split our string related calls from util.[ch] into its own file ↵Lennart Poettering
string-util.[ch] There are more than enough calls doing string manipulations to deserve its own files, hence do something about it. This patch also sorts the #include blocks of all files that needed to be updated, according to the sorting suggestions from CODING_STYLE. Since pretty much every file needs our string manipulation functions this effectively means that most files have sorted #include blocks now. Also touches a few unrelated include files.
2015-06-11build-sys: split internal basic/ library from shared/Kay Sievers
basic/ can be used by everything cannot use anything outside of basic/ libsystemd/ can use basic/ cannot use shared/ shared/ can use libsystemd/