diff options
Diffstat (limited to 'cli/mmcli-modem-location.c')
-rw-r--r-- | cli/mmcli-modem-location.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/cli/mmcli-modem-location.c b/cli/mmcli-modem-location.c index 49afd0ac..22e7aa1a 100644 --- a/cli/mmcli-modem-location.c +++ b/cli/mmcli-modem-location.c @@ -120,11 +120,17 @@ context_free (Context *ctx) static void ensure_modem_location (void) { - if (ctx->modem_location) - return; + if (mm_modem_get_unlock_required (mm_object_peek_modem (ctx->object)) != MM_MODEM_LOCK_NONE) { + g_printerr ("error: modem not unlocked yet\n"); + exit (EXIT_FAILURE); + } + + if (!ctx->modem_location) { + g_printerr ("error: modem has no location capabilities\n"); + exit (EXIT_FAILURE); + } - g_printerr ("error: modem has no location capabilities\n"); - exit (EXIT_FAILURE); + /* Success */ } void |