src/shared/replace-var.h \
src/shared/spawn-polkit-agent.c \
src/shared/spawn-polkit-agent.h \
- src/shared/hwclock.c \
- src/shared/hwclock.h \
+ src/shared/clock-util.c \
+ src/shared/clock-util.h \
src/shared/time-dst.c \
src/shared/time-dst.h \
src/shared/calendarspec.c \
#include "install.h"
#include "selinux-access.h"
#include "watchdog.h"
-#include "hwclock.h"
+#include "clock-util.h"
#include "path-util.h"
#include "virt.h"
#include "architecture.h"
if (access("/proc/cgroups", F_OK) < 0)
e = stpcpy(e, "cgroups-missing:");
- if (hwclock_is_localtime() > 0)
+ if (clock_is_localtime() > 0)
e = stpcpy(e, "local-hwclock:");
/* remove the last ':' */
#include "capability.h"
#include "killall.h"
#include "env-util.h"
-#include "hwclock.h"
+#include "clock-util.h"
#include "fileio.h"
#include "dbus-manager.h"
#include "bus-error.h"
goto finish;
if (!skip_setup) {
- if (hwclock_is_localtime() > 0) {
+ if (clock_is_localtime() > 0) {
int min;
/* The first-time call to settimeofday() does a time warp in the kernel */
- r = hwclock_set_timezone(&min);
+ r = clock_set_timezone(&min);
if (r < 0)
log_error("Failed to apply local time delta, ignoring: %s", strerror(-r));
else
* that way. In such case, we need to delay the time-warp or the sealing
* until we reach the real system.
*/
- hwclock_reset_timezone();
+ clock_reset_timezone();
/* Tell the kernel our timezone */
- r = hwclock_set_timezone(NULL);
+ r = clock_set_timezone(NULL);
if (r < 0)
log_error("Failed to set the kernel's timezone, ignoring: %s", strerror(-r));
}
#include "util.h"
#include "spawn-polkit-agent.h"
#include "build.h"
-#include "hwclock.h"
+#include "clock-util.h"
#include "strv.h"
#include "sd-id128.h"
#include "virt.h"
#include "util.h"
#include "log.h"
#include "strv.h"
-#include "hwclock.h"
+#include "clock-util.h"
#include "fileio.h"
-int hwclock_get_time(struct tm *tm) {
+int clock_get_time(struct tm *tm) {
_cleanup_close_ int fd = -1;
assert(tm);
return 0;
}
-int hwclock_set_time(const struct tm *tm) {
+int clock_set_time(const struct tm *tm) {
_cleanup_close_ int fd = -1;
assert(tm);
return 0;
}
-int hwclock_is_localtime(void) {
+int clock_is_localtime(void) {
_cleanup_fclose_ FILE *f;
/*
return 0;
}
-int hwclock_set_timezone(int *min) {
+int clock_set_timezone(int *min) {
const struct timeval *tv_null = NULL;
struct timespec ts;
struct tm *tm;
return 0;
}
-int hwclock_reset_timezone(void) {
+int clock_reset_timezone(void) {
const struct timeval *tv_null = NULL;
struct timezone tz;
along with systemd; If not, see <http://www.gnu.org/licenses/>.
***/
-int hwclock_is_localtime(void);
-int hwclock_set_timezone(int *min);
-int hwclock_reset_timezone(void);
-int hwclock_get_time(struct tm *tm);
-int hwclock_set_time(const struct tm *tm);
+int clock_is_localtime(void);
+int clock_set_timezone(int *min);
+int clock_reset_timezone(void);
+int clock_get_time(struct tm *tm);
+int clock_set_time(const struct tm *tm);
#include "util.h"
#include "strv.h"
#include "def.h"
-#include "hwclock.h"
+#include "clock-util.h"
#include "conf-files.h"
#include "path-util.h"
#include "fileio-label.h"
c->zone = NULL;
}
- c->local_rtc = hwclock_is_localtime() > 0;
+ c->local_rtc = clock_is_localtime() > 0;
return 0;
}
int r;
zero(tm);
- r = hwclock_get_time(&tm);
+ r = clock_get_time(&tm);
if (r == -EBUSY) {
log_warning("/dev/rtc is busy. Is somebody keeping it open continuously? That's not a good idea... Returning a bogus RTC timestamp.");
t = 0;
}
/* 2. Tell the kernel our timezone */
- hwclock_set_timezone(NULL);
+ clock_set_timezone(NULL);
if (c->local_rtc) {
struct timespec ts;
/* 3. Sync RTC from system clock, with the new delta */
assert_se(clock_gettime(CLOCK_REALTIME, &ts) == 0);
assert_se(tm = localtime(&ts.tv_sec));
- hwclock_set_time(tm);
+ clock_set_time(tm);
}
log_struct(LOG_INFO,
}
/* 2. Tell the kernel our timezone */
- hwclock_set_timezone(NULL);
+ clock_set_timezone(NULL);
/* 3. Synchronize clocks */
assert_se(clock_gettime(CLOCK_REALTIME, &ts) == 0);
/* Override the main fields of
* struct tm, but not the timezone
* fields */
- if (hwclock_get_time(&tm) >= 0) {
+ if (clock_get_time(&tm) >= 0) {
/* And set the system clock
* with this */
else
tm = gmtime(&ts.tv_sec);
- hwclock_set_time(tm);
+ clock_set_time(tm);
}
log_info("RTC configured to %s time.", c->local_rtc ? "local" : "UTC");
else
tm = gmtime(&ts.tv_sec);
- hwclock_set_time(tm);
+ clock_set_time(tm);
log_struct(LOG_INFO,
MESSAGE_ID(SD_MESSAGE_TIME_CHANGE),