timesync: make public defines for clock epoch files

No functional change yet, just moving stuff around and message format
adjustments.

EPOCH_CLOCK_FILE is also made public for consistency, even though I don't
plan to use it outside of the one location.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek
2024-06-05 14:35:56 +02:00
parent f11aaf7dfb
commit 455a2eb953
5 changed files with 19 additions and 19 deletions
+2 -4
View File
@@ -132,8 +132,6 @@ int clock_reset_timewarp(void) {
return RET_NERRNO(settimeofday(NULL, &tz));
}
#define EPOCH_FILE "/usr/lib/clock-epoch"
int clock_apply_epoch(ClockChangeDirection *ret_attempted_change) {
usec_t epoch_usec, now_usec;
struct stat st;
@@ -143,9 +141,9 @@ int clock_apply_epoch(ClockChangeDirection *ret_attempted_change) {
assert(ret_attempted_change);
if (stat(EPOCH_FILE, &st) < 0) {
if (stat(EPOCH_CLOCK_FILE, &st) < 0) {
if (errno != ENOENT)
log_warning_errno(errno, "Cannot stat " EPOCH_FILE ": %m");
log_warning_errno(errno, "Cannot stat " EPOCH_CLOCK_FILE ": %m");
epoch_usec = (usec_t) TIME_EPOCH * USEC_PER_SEC;
} else