From 7f54269accac8b4e36c87d3ba297b9a9a122504d Mon Sep 17 00:00:00 2001 From: Anderson Lizardo Date: Fri, 18 Nov 2011 11:08:50 -0400 Subject: [PATCH] serial: Fix error handling in connect_port() bt_io_connect() does not set errno on error, instead it uses GError. For now, simply return -EIO if bt_io_connect() fails. The serial plug-in code can be changed later to use and set GError appropriately. --- serial/port.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/serial/port.c b/serial/port.c index 3b36d44cd..5b76d1413 100644 --- a/serial/port.c +++ b/serial/port.c @@ -463,10 +463,10 @@ connect: BT_IO_OPT_DEST_BDADDR, &device->dst, BT_IO_OPT_CHANNEL, port->channel, BT_IO_OPT_INVALID); - if (port->io) - return 0; + if (port->io == NULL) + return -EIO; - return -errno; + return 0; } static struct serial_port *create_port(struct serial_device *device, -- 2.47.3