From 0dbb04b93f52c5d7e0ef70855a6c3a360179bfae Mon Sep 17 00:00:00 2001 From: Marcel Holtmann Date: Tue, 20 May 2014 21:45:03 -0700 Subject: [PATCH] client: Lookup the private daemon bus --- Makefile.am | 3 ++- client/main.c | 24 +++++++++++++++++++++++- 2 files changed, 25 insertions(+), 2 deletions(-) diff --git a/Makefile.am b/Makefile.am index 750190be..b2ee8b10 100644 --- a/Makefile.am +++ b/Makefile.am @@ -38,7 +38,8 @@ src_iwd_SOURCES = src/main.c linux/nl80211.h linux/kdbus.h \ src/sha1.h src/sha1.c src_iwd_LDADD = ell/libell-internal.la -client_iwctl_SOURCES = client/main.c +client_iwctl_SOURCES = client/main.c linux/kdbus.h \ + src/kdbus.h src/kdbus.c client_iwctl_LDADD = ell/libell-internal.la noinst_PROGRAMS = diff --git a/client/main.c b/client/main.c index a9c9886d..1a6f0046 100644 --- a/client/main.c +++ b/client/main.c @@ -25,8 +25,30 @@ #endif #include +#include + +#include "src/kdbus.h" int main(int argc, char *argv[]) { - return EXIT_SUCCESS; + char *bus_name; + int exit_status; + + l_log_set_stderr(); + l_debug_enable("*"); + + bus_name = kdbus_lookup_bus(); + if (!bus_name) { + exit_status = EXIT_FAILURE; + goto done; + } + + l_debug("Bus location: %s", bus_name); + + exit_status = EXIT_SUCCESS; + + l_free(bus_name); + +done: + return exit_status; }