aboutsummaryrefslogtreecommitdiff
path: root/src/mm-qcdm-serial-port.c
diff options
context:
space:
mode:
authorGuido Günther <agx@sigxcpu.org>2014-02-05 08:38:27 +0100
committerGuido Günther <agx@sigxcpu.org>2014-02-05 08:38:27 +0100
commit14d771b90f5a7d3887e5e900d1fb4737477ad305 (patch)
treef382e3359d20916ae60d28361e59635e373224f8 /src/mm-qcdm-serial-port.c
parenta09050a7f63a262bf90dcb1c7a41f9cfd205db43 (diff)
Imported Upstream version 0.5.2.0upstream/0.5.2.0
Diffstat (limited to 'src/mm-qcdm-serial-port.c')
-rw-r--r--src/mm-qcdm-serial-port.c14
1 files changed, 12 insertions, 2 deletions
diff --git a/src/mm-qcdm-serial-port.c b/src/mm-qcdm-serial-port.c
index e467f2a..0d763bf 100644
--- a/src/mm-qcdm-serial-port.c
+++ b/src/mm-qcdm-serial-port.c
@@ -23,6 +23,7 @@
#include "mm-errors.h"
#include "libqcdm/src/com.h"
#include "libqcdm/src/utils.h"
+#include "libqcdm/src/errors.h"
#include "mm-log.h"
G_DEFINE_TYPE (MMQcdmSerialPort, mm_qcdm_serial_port, MM_TYPE_SERIAL_PORT)
@@ -81,7 +82,8 @@ handle_response (MMSerialPort *port,
GError *dm_error = NULL;
gsize used = 0;
gsize start = 0;
- gboolean success = FALSE, more = FALSE;
+ gboolean success = FALSE;
+ qcdmbool more = FALSE;
gsize unescaped_len = 0;
if (error)
@@ -200,7 +202,15 @@ debug_log (MMSerialPort *port, const char *prefix, const char *buf, gsize len)
static gboolean
config_fd (MMSerialPort *port, int fd, GError **error)
{
- return qcdm_port_setup (fd, error);
+ int err;
+
+ err = qcdm_port_setup (fd);
+ if (err != QCDM_SUCCESS) {
+ g_set_error (error, MM_SERIAL_ERROR, MM_SERIAL_ERROR_OPEN_FAILED,
+ "Failed to open QCDM port: %d", err);
+ return FALSE;
+ }
+ return TRUE;
}
/*****************************************************************************/