From 08b6b2981b3fb35764c5ab46af27ad210cb96f37 Mon Sep 17 00:00:00 2001 From: Paul Wise Date: Sun, 2 Nov 2014 08:22:47 +0800 Subject: Properly handle errors bootstrapping modem --- tools/ipc-modem.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/tools/ipc-modem.c b/tools/ipc-modem.c index 1509802..ad92113 100644 --- a/tools/ipc-modem.c +++ b/tools/ipc-modem.c @@ -431,7 +431,9 @@ int modem_start(struct ipc_client *client) int rc = -1; ipc_client_data_create(client); - ipc_client_boot(client); + rc = ipc_client_boot(client); + if(rc < 0) + return -1; usleep(300); @@ -536,7 +538,9 @@ int main(int argc, char *argv[]) printf("[E] Something went wrong while powering modem off\n"); goto modem_quit; } else if (strncmp(argv[optind], "boot", 9) == 0) { - ipc_client_boot(client_fmt); + rc = ipc_client_boot(client_fmt); + if (rc < 0) + printf("[E] Something went wrong while bootstrapping modem\n"); } else if(strncmp(argv[optind], "start", 5) == 0) { printf("[0] Starting modem on FMT client\n"); rc = modem_start(client_fmt); -- cgit v1.1