diff options
author | William Jon McCann <mccann@jhu.edu> | 2007-09-19 11:13:31 -0400 |
---|---|---|
committer | William Jon McCann <mccann@jhu.edu> | 2007-09-19 11:13:31 -0400 |
commit | 03c9196f59c849515f650e2eb1a190a10908a8ee (patch) | |
tree | 39aecff30141c53364e49002e8fc9af90edb1937 /src | |
parent | 54582a7287f036bd6b65434e4b4888405972130d (diff) |
try to make things work for systems that don't support VT_ACTIVATE etc
Diffstat (limited to 'src')
-rw-r--r-- | src/ck-sysdeps-unix.c | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/src/ck-sysdeps-unix.c b/src/ck-sysdeps-unix.c index 0001b6b..be093b7 100644 --- a/src/ck-sysdeps-unix.c +++ b/src/ck-sysdeps-unix.c @@ -33,10 +33,13 @@ #ifdef __linux__ #include <linux/kd.h> +#endif + +#ifdef HAVE_SYS_VT_H #include <sys/vt.h> #endif -#ifdef __FreeBSD__ +#if HAVE_SYS_CONSIO_H #include <sys/consio.h> #endif @@ -252,11 +255,15 @@ ck_wait_for_active_console_num (int console_fd, again: ret = FALSE; - g_debug ("VT_WAITACTIVE for vt %d", num); errno = 0; +#ifdef VT_WAITACTIVE + g_debug ("VT_WAITACTIVE for vt %d", num); res = ioctl (console_fd, VT_WAITACTIVE, num); - g_debug ("VT_WAITACTIVE for vt %d returned %d", num, ret); +#else + res = ERROR; + errno = ENOTSUP; +#endif if (res == ERROR) { const char *errmsg; @@ -268,6 +275,8 @@ ck_wait_for_active_console_num (int console_fd, num, errmsg); goto again; + } else if (errno == ENOTSUP) { + g_debug ("Console activation not supported on this system"); } else { g_warning ("Error waiting for native console %d activation: %s", num, @@ -294,11 +303,21 @@ ck_activate_console_num (int console_fd, ret = FALSE; errno = 0; +#ifdef VT_ACTIVATE res = ioctl (console_fd, VT_ACTIVATE, num); +#else + res = ERROR; + errno = ENOTSUP; +#endif + if (res == 0) { ret = TRUE; } else { - g_warning ("Unable to activate console: %s", g_strerror (errno)); + if (errno == ENOTSUP) { + g_debug ("Console activation not supported on this system"); + } else { + g_warning ("Unable to activate console: %s", g_strerror (errno)); + } } return ret; |