summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Koegel <eric.koegel@gmail.com>2017-06-21 09:22:14 +0300
committerEric Koegel <eric.koegel@gmail.com>2017-06-21 19:53:09 +0300
commitaf3eb3e8de4a9936efa5ec600a1ac5a4bd185f6a (patch)
tree878c4da5bf8d805e40a4fc10d26ea7f4f1c7b866
parent1585a3d9b32ff3c17759e7d22fd8ee47af6b9919 (diff)
downloadConsoleKit2-af3eb3e8de4a9936efa5ec600a1ac5a4bd185f6a.tar.gz
fix: Explicitly check for needed symbols
Such as VT_RELDISP, rather than a specific header file. This will fix VT calls not being built on FreeBSD.
-rw-r--r--src/ck-session.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/ck-session.c b/src/ck-session.c
index c33985e..4a23272 100644
--- a/src/ck-session.c
+++ b/src/ck-session.c
@@ -1380,7 +1380,7 @@ vt_leave_handler (gpointer data)
ck_session_pause_all_devices (session, TRUE);
/* release control */
-#ifdef HAVE_SYS_VT_H
+#if defined(VT_RELDISP)
ioctl (session->priv->tty_fd, VT_RELDISP, 1);
#endif
@@ -1399,7 +1399,7 @@ vt_acquire_handler (gpointer data)
/* ack that we are getting control, but let the normal
* process handle granting access */
-#ifdef HAVE_SYS_VT_H
+#if defined(VT_RELDISP)
ioctl (session->priv->tty_fd, VT_RELDISP, VT_ACKACQ);
#endif
@@ -1410,7 +1410,7 @@ static void
ck_session_setup_vt_signal (CkSession *session,
guint vtnr)
{
-#ifdef HAVE_SYS_VT_H
+#if defined(KDGKBMODE) && defined(KDGETMODE) && defined(KDSETMODE) && defined(KD_GRAPHICS)
struct vt_mode mode = { 0 };
int graphical_mode;
@@ -1469,7 +1469,7 @@ ck_session_setup_vt_signal (CkSession *session,
(GSourceFunc)vt_acquire_handler,
session,
NULL);
-#endif /* HAVE_SYS_VT_H */
+#endif /* defined(KDGKBMODE) && defined(KDGETMODE) && defined(KDSETMODE) && defined(KD_GRAPHICS) */
}
static void
@@ -1508,7 +1508,7 @@ ck_session_controller_cleanup (CkSession *session)
ck_session_remove_all_devices (session);
-#ifdef HAVE_SYS_VT_H
+#if defined(VT_SETMODE)
/* Remove the old signal call backs, restore VT switching to auto
* and text mode (put it back the way we found it) */
if (session->priv->sig_watch_s1 != 0) {
@@ -1544,7 +1544,7 @@ ck_session_controller_cleanup (CkSession *session)
g_close (session->priv->tty_fd, NULL);
session->priv->tty_fd = -1;
}
-#endif /* HAVE_SYS_VT_H */
+#endif /* defined(VT_SETMODE) */
}
void