From: Mike Yuan Date: Mon, 28 Aug 2023 12:44:19 +0000 (+0800) Subject: logind: rephrase log messages X-Git-Tag: v255-rc1~624^2~3 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=36f9fadfe3b61f94fee5c2187e3d380965e9654d;p=thirdparty%2Fsystemd.git logind: rephrase log messages --- diff --git a/src/login/logind-session.c b/src/login/logind-session.c index 89dbfe840ad..4d1caee4d37 100644 --- a/src/login/logind-session.c +++ b/src/login/logind-session.c @@ -1302,7 +1302,7 @@ static int session_open_vt(Session *s) { sprintf(path, "/dev/tty%u", s->vtnr); s->vtfd = open_terminal(path, O_RDWR | O_CLOEXEC | O_NONBLOCK | O_NOCTTY); if (s->vtfd < 0) - return log_error_errno(s->vtfd, "cannot open VT %s of session %s: %m", path, s->id); + return log_error_errno(s->vtfd, "Cannot open VT %s of session %s: %m", path, s->id); return s->vtfd; } diff --git a/src/login/logind.c b/src/login/logind.c index ba3a31b0a40..78716f33030 100644 --- a/src/login/logind.c +++ b/src/login/logind.c @@ -704,6 +704,7 @@ static int manager_vt_switch(sd_event_source *src, const struct signalfd_siginfo */ assert(m->seat0); + seat_read_active_vt(m->seat0); active = m->seat0->active; @@ -719,17 +720,16 @@ static int manager_vt_switch(sd_event_source *src, const struct signalfd_siginfo log_warning("Received VT_PROCESS signal without a registered session, restoring VT."); - /* At this point we only have the kernel mapping for referring to the - * current VT. */ + /* At this point we only have the kernel mapping for referring to the current VT. */ fd = open_terminal("/dev/tty0", O_RDWR|O_NOCTTY|O_CLOEXEC|O_NONBLOCK); if (fd < 0) { - log_warning_errno(fd, "Failed to open, ignoring: %m"); + log_warning_errno(fd, "Failed to open current VT, ignoring: %m"); return 0; } - r = vt_release(fd, true); + r = vt_release(fd, /* restore = */ true); if (r < 0) - log_warning_errno(r, "Failed to release VT, ignoring: %m"); + log_warning_errno(r, "Failed to release current VT, ignoring: %m"); return 0; }