From fb0265f553ca0efe8aac0f10de480bffeff1a33d Mon Sep 17 00:00:00 2001 From: erin_yueh Date: Fri, 8 Feb 2008 18:02:15 +0000 Subject: gsmd: fix error handling in libgsmd-tool (Paulius Zaleckas) git-svn-id: http://svn.openmoko.org/trunk/src/target/gsm@4030 99fdad57-331a-0410-800a-d7fa5415bdb3 --- src/util/atcmd.c | 2 +- src/util/shell.c | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) (limited to 'src/util') diff --git a/src/util/atcmd.c b/src/util/atcmd.c index 88703d0..c84c3ec 100644 --- a/src/util/atcmd.c +++ b/src/util/atcmd.c @@ -75,7 +75,7 @@ int atcmd_main(struct lgsm_handle *lgsmh) } rc = lgsm_handle_packet(lgsmh, buf, rc); if (rc < 0) - printf("ERROR processing packet: %d(%s)\n", rc, strerror(rc)); + printf("ERROR processing packet: %d(%s)\n", rc, strerror(-rc)); } if (FD_ISSET(0, &readset)) { /* we've received something on stdin. send it as passthrough diff --git a/src/util/shell.c b/src/util/shell.c index ae92611..b7d65f5 100644 --- a/src/util/shell.c +++ b/src/util/shell.c @@ -605,6 +605,8 @@ int shell_main(struct lgsm_handle *lgsmh, int sync) break; } rc = lgsm_handle_packet(lgsmh, buf, rc); + if (rc < 0) + printf("ERROR processing packet: %d(%s)\n", rc, strerror(-rc)); } if (FD_ISSET(0, &readset)) { /* we've received something on stdin. */ -- cgit v1.2.3