[gdm/wip/systemd-activation: 1/4] worker: fail if unable to open VT's terminal



commit 2b79c77612048a8888660ee2613924bb6c7aecd8
Author: Ray Strode <rstrode redhat com>
Date:   Tue Apr 22 12:12:48 2014 -0400

    worker: fail if unable to open VT's terminal
    
    This commit just adds better error handling.

 daemon/gdm-session-worker.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/daemon/gdm-session-worker.c b/daemon/gdm-session-worker.c
index 5fc42c6..4cbb529 100644
--- a/daemon/gdm-session-worker.c
+++ b/daemon/gdm-session-worker.c
@@ -2028,6 +2028,12 @@ set_up_for_new_vt (GdmSessionWorker *worker)
 
         g_snprintf (tty_string, 256, "/dev/tty%d", session_vt);
         worker->priv->session_tty_fd = open (tty_string, O_RDWR | O_NOCTTY);
+
+        if (worker->priv->session_tty_fd < 0) {
+                g_warning ("GdmSessionWorker: couln't open terminal %s for VT %s: %m", tty_string, 
vt_string);
+                goto fail;
+        }
+
         pam_set_item (worker->priv->pam_handle, PAM_TTY, tty_string);
 
         return TRUE;


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