diff options
Diffstat (limited to 'cli/mmcli-modem-time.c')
-rw-r--r-- | cli/mmcli-modem-time.c | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/cli/mmcli-modem-time.c b/cli/mmcli-modem-time.c index 8ec5740c..7bc277c6 100644 --- a/cli/mmcli-modem-time.c +++ b/cli/mmcli-modem-time.c @@ -108,11 +108,17 @@ context_free (Context *ctx) static void ensure_modem_time (void) { - if (ctx->modem_time) - 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_time) { + g_printerr ("error: modem has no time capabilities\n"); + exit (EXIT_FAILURE); + } - g_printerr ("error: modem has no time capabilities\n"); - exit (EXIT_FAILURE); + /* Success */ } void |