X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?p=elogind.git;a=blobdiff_plain;f=src%2Fmain.c;h=e10441c862d7766ea06890afd33113712ce6c1bc;hp=176a4f5ecbbb4be8e9c6712ce32e657bbbf9a35d;hb=30b2c336d80aa08ffcc6ebba9540b15b07563a73;hpb=871c44a747a8bf4465cbfda445216e9ac66d4a40 diff --git a/src/main.c b/src/main.c index 176a4f5ec..e10441c86 100644 --- a/src/main.c +++ b/src/main.c @@ -169,7 +169,7 @@ _noreturn_ static void crash(int sig) { _exit(1); } - log_info("Successfully spawned crash shall as pid %lu.", (unsigned long) pid); + log_info("Successfully spawned crash shell as pid %lu.", (unsigned long) pid); } log_info("Freezing execution."); @@ -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); @@ -1033,6 +1033,8 @@ int main(int argc, char *argv[]) { program_invocation_short_name = systemd; prctl(PR_SET_NAME, systemd); + saved_argv = argv; + saved_argc = argc; log_show_color(isatty(STDERR_FILENO) > 0); log_show_location(false); @@ -1049,6 +1051,16 @@ int main(int argc, char *argv[]) { if (label_init() < 0) goto finish; + + if (hwclock_is_localtime() > 0) { + int min; + + min = hwclock_apply_localtime_delta(); + if (min < 0) + log_error("Failed to apply local time delta: %s", strerror(-min)); + else + log_info("RTC 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 +1105,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 +1184,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();