From 6dea9964bec11ac168835afc397d4bef061cc4c1 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Thu, 15 Mar 2012 12:49:06 +0100 Subject: mmcli: fix looking for unexisting bearers We need to ensure we iterate over all modems available. --- cli/mmcli-common.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cli/mmcli-common.c') diff --git a/cli/mmcli-common.c b/cli/mmcli-common.c index db1e06ab..bc0365cb 100644 --- a/cli/mmcli-common.c +++ b/cli/mmcli-common.c @@ -340,8 +340,6 @@ find_bearer_in_list (GList *list, } } - g_printerr ("error: couldn't find bearer at '%s'\n", bearer_path); - exit (EXIT_FAILURE); return NULL; } @@ -518,6 +516,12 @@ mmcli_get_bearer_sync (GDBusConnection *connection, g_object_unref (modem); } + if (!found) { + g_printerr ("error: couldn't find bearer at '%s': 'not found in any modem'\n", + bearer_path); + exit (EXIT_FAILURE); + } + g_list_free_full (modems, (GDestroyNotify) g_object_unref); g_free (bearer_path); -- cgit v1.2.3-70-g09d2