pespin has submitted this change. ( 
https://gerrit.osmocom.org/c/osmocom-bb/+/32422 )

Change subject: mobile: Fail VTY command if attching test SIM card fails
......................................................................

mobile: Fail VTY command if attching test SIM card fails

Change-Id: Ie5a395de6c926f13ce9324b93da0e348da5438d1
---
M src/host/layer23/src/mobile/vty_interface.c
1 file changed, 15 insertions(+), 1 deletion(-)

Approvals:
  laforge: Looks good to me, but someone else must approve
  osmith: Looks good to me, approved
  Jenkins Builder: Verified
  fixeria: Looks good to me, approved




diff --git a/src/host/layer23/src/mobile/vty_interface.c 
b/src/host/layer23/src/mobile/vty_interface.c
index 57d02e6..e7f0454 100644
--- a/src/host/layer23/src/mobile/vty_interface.c
+++ b/src/host/layer23/src/mobile/vty_interface.c
@@ -434,6 +434,7 @@
 {
        struct osmocom_ms *ms;
        struct gsm_settings *set;
+       int rc;

        /* Initial testcard settings */
        uint16_t mcc = 0x001, mnc = 0x01f, lac = 0x0000;
@@ -484,7 +485,11 @@
        if (argc >= 5)
                tmsi = strtoul(argv[4], NULL, 16);

-       gsm_subscr_testcard(ms, mcc, mnc, lac, tmsi, attached);
+       rc = gsm_subscr_testcard(ms, mcc, mnc, lac, tmsi, attached);
+       if (rc < 0) {
+               vty_out(vty, "Attach test SIM card failed: %d%s", rc, 
VTY_NEWLINE);
+               return CMD_WARNING;
+       }

        return CMD_SUCCESS;
 }

--
To view, visit https://gerrit.osmocom.org/c/osmocom-bb/+/32422
To unsubscribe, or for help writing mail filters, visit 
https://gerrit.osmocom.org/settings

Gerrit-Project: osmocom-bb
Gerrit-Branch: master
Gerrit-Change-Id: Ie5a395de6c926f13ce9324b93da0e348da5438d1
Gerrit-Change-Number: 32422
Gerrit-PatchSet: 3
Gerrit-Owner: pespin <[email protected]>
Gerrit-Reviewer: Jenkins Builder
Gerrit-Reviewer: fixeria <[email protected]>
Gerrit-Reviewer: laforge <[email protected]>
Gerrit-Reviewer: osmith <[email protected]>
Gerrit-Reviewer: pespin <[email protected]>
Gerrit-MessageType: merged

Reply via email to