aboutsummaryrefslogtreecommitdiffstats
path: root/logind.c
diff options
context:
space:
mode:
authorGerd Hoffmann <kraxel@redhat.com>2019-03-06 21:46:45 +0100
committerGerd Hoffmann <kraxel@redhat.com>2019-03-06 21:46:45 +0100
commit9c62b1936688349b46c597bc9c7110ff7234620b (patch)
tree9df1b3b4c31e47fe15ed9dea0a709d94534e2994 /logind.c
parent70487f2317f1ac37686f5da1852a93d147cc6d6a (diff)
downloadfbida-9c62b1936688349b46c597bc9c7110ff7234620b.tar.gz
some logind vt switch bits
Diffstat (limited to 'logind.c')
-rw-r--r--logind.c37
1 files changed, 37 insertions, 0 deletions
diff --git a/logind.c b/logind.c
index a2e9add..9e64013 100644
--- a/logind.c
+++ b/logind.c
@@ -69,6 +69,33 @@ void logind_dbus_input(void)
} while (ret > 0);
}
+int logind_switch_vt(int vt)
+{
+ sd_bus_error error = SD_BUS_ERROR_NULL;
+ sd_bus_message *m = NULL;
+ int r;
+
+ if (!logind_dbus)
+ return -1;
+
+ r = sd_bus_call_method(logind_dbus,
+ "org.freedesktop.login1",
+ "/org/freedesktop/login1/seat/self",
+ "org.freedesktop.login1.Seat",
+ "SwitchTo",
+ &error,
+ &m,
+ "u",
+ vt);
+ if (r < 0) {
+ fprintf(stderr, "SwitchTo failed: %s\n", error.message);
+ sd_bus_error_free(&error);
+ }
+ sd_bus_message_unref(m);
+
+ return r;
+}
+
int logind_take_control(void)
{
sd_bus_error error = SD_BUS_ERROR_NULL;
@@ -230,11 +257,21 @@ void logind_dbus_input(void)
{
}
+int logind_switch_vt(int vt)
+{
+ return -1;
+}
+
int logind_take_control(void)
{
return -1;
}
+int logind_release_control(void)
+{
+ return -1;
+}
+
int logind_open(const char *path, int flags, void *user_data)
{
fprintf(stderr, "error: compiled without logind support.\n");