From 48b90febf13dd5713932420c7bdaf308b8388ef6 Mon Sep 17 00:00:00 2001 From: Andrew Zaborowski Date: Tue, 14 Mar 2017 00:51:19 +0100 Subject: [PATCH] hwsim: Don't handle netlink events in command mode Don't handle the hwsim netlink events we use to track radios and interfaces if we're not in daemon mode. This quiets dbus errors when using hwsim through the command line. --- tools/hwsim.c | 16 ++++++---------- 1 file changed, 6 insertions(+), 10 deletions(-) diff --git a/tools/hwsim.c b/tools/hwsim.c index 5da820be..353d1b79 100644 --- a/tools/hwsim.c +++ b/tools/hwsim.c @@ -2051,19 +2051,9 @@ error: static void hwsim_ready(void *user_data) { struct l_genl_msg *msg; - int ret; size_t msg_size; uint32_t radio_id; - ret = l_genl_family_register(hwsim, "config", hwsim_config, - NULL, NULL); - if (!ret) { - fprintf(stderr, "Failed to create hwsim config listener\n"); - exit_status = EXIT_FAILURE; - l_main_quit(); - return; - } - switch (action) { case ACTION_LIST: msg = l_genl_msg_new_sized(HWSIM_CMD_GET_RADIO, @@ -2135,6 +2125,12 @@ static void hwsim_ready(void *user_data) if (!setup_dbus_hwsim()) goto error; + if (!l_genl_family_register(hwsim, "config", hwsim_config, + NULL, NULL)) { + l_error("Failed to create hwsim config listener\n"); + goto error; + } + l_genl_family_set_watches(nl80211, nl80211_ready, NULL, NULL, NULL);