summaryrefslogtreecommitdiffstats
path: root/plugins/telit.c
diff options
context:
space:
mode:
authorGustavo F. Padovan <padovan@profusion.mobi>2011-09-29 14:54:22 -0300
committerDenis Kenzior <denkenz@gmail.com>2011-09-29 14:03:45 -0500
commit0e4a351282d56f42af9b8eb55531236d2ed6f1a6 (patch)
tree49dd44976c90054c7c0c49d96a1a900ed822981a /plugins/telit.c
parent53e005b200f29ca6c5d1bf88571ed683e87ac22b (diff)
downloadofono-0e4a351282d56f42af9b8eb55531236d2ed6f1a6.tar.bz2
telit: fix shutdown of bluetooth socket
Diffstat (limited to 'plugins/telit.c')
-rw-r--r--plugins/telit.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/plugins/telit.c b/plugins/telit.c
index 7ed52a6b..48087f22 100644
--- a/plugins/telit.c
+++ b/plugins/telit.c
@@ -474,12 +474,12 @@ static int telit_sap_enable(struct ofono_modem *modem,
fd = telit_sap_open();
if (fd < 0)
- return fd;
+ goto error;
data->hw_io = g_io_channel_unix_new(fd);
if (data->hw_io == NULL) {
close(fd);
- return -ENOMEM;
+ goto error;
}
g_io_channel_set_encoding(data->hw_io, NULL, NULL);
@@ -520,6 +520,9 @@ static int telit_sap_enable(struct ofono_modem *modem,
return -EINPROGRESS;
error:
+ shutdown(bt_fd, SHUT_RDWR);
+ close(bt_fd);
+
sap_close_io(modem);
return -EINVAL;
}