From 28f13c09ecf6433385d9b7a8cff5be825d74c9c8 Mon Sep 17 00:00:00 2001 From: Aleksander Morgado Date: Mon, 26 Mar 2012 13:00:07 +0200 Subject: mmcli: abort certain operations if modem is unlocked Do not try to perform feature/capability specific actions if we're still unlocked, as the modem didn't yet export the feature/capability specific interface. The only interfaces expected while modem is unlocked are the Modem and Simple interfaces, as well as the SIM interface in the SIM object, of course. --- cli/mmcli-modem-simple.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'cli/mmcli-modem-simple.c') diff --git a/cli/mmcli-modem-simple.c b/cli/mmcli-modem-simple.c index 29df8a34..53277038 100644 --- a/cli/mmcli-modem-simple.c +++ b/cli/mmcli-modem-simple.c @@ -125,11 +125,12 @@ context_free (Context *ctx) static void ensure_modem_simple (void) { - if (ctx->modem_simple) - return; + if (!ctx->modem_simple) { + g_printerr ("error: modem has no Simple capabilities\n"); + exit (EXIT_FAILURE); + } - g_printerr ("error: modem has no Simple capabilities\n"); - exit (EXIT_FAILURE); + /* Success */ } void -- cgit v1.2.3-70-g09d2