]> rtime.felk.cvut.cz Git - sojka/lightdm.git/commitdiff
Better simulate VT switching so tests work
authorRobert Ancell <robert.ancell@canonical.com>
Wed, 6 Mar 2013 22:35:36 +0000 (11:35 +1300)
committerRobert Ancell <robert.ancell@canonical.com>
Wed, 6 Mar 2013 22:35:36 +0000 (11:35 +1300)
tests/src/libsystem.c

index 5c20ddcea242abc8bdd60ac8ab0e2a751970155f..577e47f59aab66bfc589cd3e9c7d9e8c6c4e3a13 100644 (file)
@@ -23,6 +23,8 @@ static GList *getpwent_link = NULL;
 
 static GList *group_entries = NULL;
 
+static int active_vt = 7;
+
 struct pam_handle
 {
     char *service_name;
@@ -220,14 +222,18 @@ ioctl (int d, int request, void *data)
     if (d > 0 && d == console_fd)
     {
         struct vt_stat *console_state;
+        int *n;
 
         switch (request)
         {
         case VT_GETSTATE:
             console_state = data;
-            console_state->v_active = 7;
-            break;          
+            console_state->v_active = active_vt;
+            break;
         case VT_ACTIVATE:
+            active_vt = GPOINTER_TO_INT (data);
+            break;
+        case VT_WAITACTIVE:
             break;
         }
         return 0;