]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
logind: rephrase log messages
authorMike Yuan <me@yhndnzj.com>
Mon, 28 Aug 2023 12:44:19 +0000 (20:44 +0800)
committerMike Yuan <me@yhndnzj.com>
Mon, 28 Aug 2023 14:37:21 +0000 (22:37 +0800)
src/login/logind-session.c
src/login/logind.c

index 89dbfe840ad15bbf044550d942afa24230a737ec..4d1caee4d3793a04424b8fdd080e865463607b0a 100644 (file)
@@ -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;
 }
index ba3a31b0a405cd0deecfac9e25861fcbcb72b626..78716f33030b7fa6e9c9146615ca3e1dac767440 100644 (file)
@@ -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;
         }