3
0
mirror of https://git.kernel.org/pub/scm/network/wireless/iwd.git synced 2024-12-23 22:42:37 +01:00

client: Prepare main for the new development

This commit is contained in:
Tim Kourt 2017-03-23 09:48:55 -07:00 committed by Denis Kenzior
parent f3a60f0182
commit def38e28b6

View File

@ -24,8 +24,6 @@
#include <config.h>
#endif
#include <stdlib.h>
#include <stdio.h>
#include <ell/ell.h>
static void signal_handler(struct l_signal *signal, uint32_t signo,
@ -40,29 +38,9 @@ static void signal_handler(struct l_signal *signal, uint32_t signo,
}
}
static void signal_message(struct l_dbus_message *message, void *user_data)
{
const char *path, *interface, *member, *destination, *sender;
path = l_dbus_message_get_path(message);
destination = l_dbus_message_get_destination(message);
l_info("path=%s destination=%s", path, destination);
interface = l_dbus_message_get_interface(message);
member = l_dbus_message_get_member(message);
l_info("interface=%s member=%s", interface, member);
sender = l_dbus_message_get_sender(message);
l_info("sender=%s", sender);
}
int main(int argc, char *argv[])
{
int exit_status;
struct l_dbus *dbus;
struct l_signal *signal;
sigset_t mask;
@ -76,24 +54,11 @@ int main(int argc, char *argv[])
signal = l_signal_create(&mask, signal_handler, NULL, NULL);
l_log_set_stderr();
l_debug_enable("*");
dbus = l_dbus_new_default(L_DBUS_SYSTEM_BUS);
if (!dbus) {
exit_status = EXIT_FAILURE;
goto done;
}
l_dbus_add_signal_watch(dbus, "net.connman.iwd", NULL, NULL, NULL,
L_DBUS_MATCH_NONE, signal_message, NULL);
l_main_run();
exit_status = EXIT_SUCCESS;
l_dbus_destroy(dbus);
done:
l_signal_remove(signal);
l_main_exit();