summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorRobert Ancell <robert.ancell@canonical.com>2013-03-07 11:35:36 +1300
committerRobert Ancell <robert.ancell@canonical.com>2013-03-07 11:35:36 +1300
commit067255389e17bf6e58524e38efec537dd545448b (patch)
tree4c9f29425e376dc3d532f7d84220228782405c0c /tests
parentdf0f3553bd23a604b07494b892caee5d8d36cdaf (diff)
downloadlightdm-067255389e17bf6e58524e38efec537dd545448b.tar.gz
Better simulate VT switching so tests work
Diffstat (limited to 'tests')
-rw-r--r--tests/src/libsystem.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/tests/src/libsystem.c b/tests/src/libsystem.c
index 5c20ddce..577e47f5 100644
--- a/tests/src/libsystem.c
+++ b/tests/src/libsystem.c
@@ -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;