summaryrefslogtreecommitdiffstats
path: root/src/ck-sysdeps-solaris.c
diff options
context:
space:
mode:
authorBrian Cameron <brian.camerson@sun.com>2007-09-19 21:19:31 -0400
committerWilliam Jon McCann <mccann@jhu.edu>2007-09-19 21:19:31 -0400
commitad9dbd345dbec43ffc24481a0d21c261e49347fb (patch)
tree4f82bfed7094ba97b91deddbdc9da09067c38de9 /src/ck-sysdeps-solaris.c
parent03c9196f59c849515f650e2eb1a190a10908a8ee (diff)
don't use VT_GETSTATE when VT is unavailable
Diffstat (limited to 'src/ck-sysdeps-solaris.c')
-rw-r--r--src/ck-sysdeps-solaris.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/ck-sysdeps-solaris.c b/src/ck-sysdeps-solaris.c
index 9cfec2e..c0f333e 100644
--- a/src/ck-sysdeps-solaris.c
+++ b/src/ck-sysdeps-solaris.c
@@ -30,6 +30,10 @@
#include <sys/stat.h>
#include <sys/ioctl.h>
+#ifdef HAVE_SYS_VT_H
+#include <sys/vt.h>
+#endif
+
#define DEV_ENCODE(M,m) ( \
( (M&0xfff) << 8) | ( (m&0xfff00) << 12) | (m&0xff) \
)
@@ -432,6 +436,8 @@ ck_get_active_console_num (int console_fd,
gboolean ret;
int res;
guint active;
+
+#ifdef VT_GETSTATE
struct vt_stat stat;
g_assert (console_fd != -1);
@@ -464,6 +470,10 @@ ck_get_active_console_num (int console_fd,
if (num != NULL) {
*num = active;
}
+#else
+ res = ERROR;
+ errno = ENOTSUP;
+#endif
return ret;
}