[gdm] worker: add some debug messages



commit 04c0d76f70719dc16b32efdb5c677255fe7467bf
Author: Ray Strode <rstrode redhat com>
Date:   Fri Feb 27 12:24:21 2015 -0500

    worker: add some debug messages
    
    This will make it clear what VT we're on,
    and whether or not the session has control of the tty..

 daemon/gdm-session-worker.c |   14 +++++++++++---
 1 files changed, 11 insertions(+), 3 deletions(-)
---
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
index 470428b..90c9245 100644
--- a/daemon/gdm-session-worker.c
+++ b/daemon/gdm-session-worker.c
@@ -989,17 +989,23 @@ jump_to_vt (GdmSessionWorker  *worker,
         int fd;
         gboolean just_opened_tty = FALSE;
 
+        g_debug ("GdmSessionWorker: jumping to VT %d", vt_number);
         if (worker->priv->session_tty_fd != -1) {
                 struct vt_mode setmode_request = { 0 };
 
                 fd = worker->priv->session_tty_fd;
 
-                ioctl (fd, KDSETMODE, KD_GRAPHICS);
+                g_debug ("GdmSessionWorker: first setting graphics mode to prevent flicker");
+                if (ioctl (fd, KDSETMODE, KD_GRAPHICS) < 0) {
+                        g_debug ("GdmSessionWorker: couldn't set graphics mode: %m");
+                }
 
                 setmode_request.mode = VT_PROCESS;
                 setmode_request.relsig = RELEASE_DISPLAY_SIGNAL;
                 setmode_request.acqsig = ACQUIRE_DISPLAY_SIGNAL;
-                ioctl (fd, VT_SETMODE, &setmode_request);
+                if (ioctl (fd, VT_SETMODE, &setmode_request) < 0) {
+                        g_debug ("GdmSessionWorker: couldn't manage VTs manually: %m");
+                }
 
                 signal (RELEASE_DISPLAY_SIGNAL, on_release_display);
                 signal (ACQUIRE_DISPLAY_SIGNAL, on_acquire_display);
@@ -1929,7 +1935,9 @@ gdm_session_worker_start_session (GdmSessionWorker  *worker,
                 /* Take control of the tty
                  */
                 if (needs_controlling_terminal) {
-                        ioctl (STDIN_FILENO, TIOCSCTTY, 0);
+                        if (ioctl (STDIN_FILENO, TIOCSCTTY, 0) < 0) {
+                                g_debug ("GdmSessionWorker: could not take control of tty: %m");
+                        }
                 }
 #endif
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]