chiark / gitweb /
rtc in localtime: use settimeofday(NULL, tz) instead of hwclock(8)
[elogind.git] / src / main.c
index 176a4f5ecbbb4be8e9c6712ce32e657bbbf9a35d..68328b76d3161317500773455e1fc39b4ea0cd3e 100644 (file)
@@ -203,7 +203,7 @@ static int console_setup(bool do_reset) {
                 return -tty_fd;
         }
 
-        if ((r = reset_terminal(tty_fd)) < 0)
+        if ((r = reset_terminal_fd(tty_fd)) < 0)
                 log_error("Failed to reset /dev/console: %s", strerror(-r));
 
         close_nointr_nofail(tty_fd);
@@ -1049,6 +1049,13 @@ int main(int argc, char *argv[]) {
 
                 if (label_init() < 0)
                         goto finish;
+
+                if (hwclock_is_localtime()) {
+                        int min;
+
+                        min = hwclock_apply_localtime_delta();
+                        log_info("Hwclock configured in localtime, applying delta of %i minutes to system time", min);
+                }
         } else {
                 arg_running_as = MANAGER_USER;
                 log_set_target(LOG_TARGET_CONSOLE);
@@ -1093,11 +1100,6 @@ int main(int argc, char *argv[]) {
                 goto finish;
         }
 
-        /* If Plymouth is being run make sure we show the status, so
-         * that there's something nice to see when people press Esc */
-        if (access("/run/initramfs/plymouth", F_OK) >= 0)
-                arg_show_status = true;
-
         if (arg_action == ACTION_HELP) {
                 retval = help();
                 goto finish;
@@ -1177,7 +1179,7 @@ int main(int argc, char *argv[]) {
         if (arg_running_as == MANAGER_SYSTEM && !serialization) {
                 locale_setup();
 
-                if (arg_show_status)
+                if (arg_show_status || plymouth_running())
                         status_welcome();
 
                 kmod_setup();