summaryrefslogtreecommitdiff
path: root/network
diff options
context:
space:
mode:
authorLuiz Augusto von Dentz <luiz.dentz-von@nokia.com>2011-01-19 13:54:17 +0200
committerLuiz Augusto von Dentz <luiz.dentz-von@nokia.com>2011-01-19 13:54:17 +0200
commita0d572c60028fbd78e7dcf39890470ec46fba5d4 (patch)
treec0ccc500d4ca2cdfe36e7dc75d051842248e74bf /network
parent291b8885cd2b2c8459923c56b21ad41646f8e79c (diff)
downloadbluez-a0d572c60028fbd78e7dcf39890470ec46fba5d4.tar.gz
Fix use of deprecated glib on network plugin
Diffstat (limited to 'network')
-rw-r--r--network/connection.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/network/connection.c b/network/connection.c
index 09a4f3ccc..f4dd74ea7 100644
--- a/network/connection.c
+++ b/network/connection.c
@@ -195,7 +195,7 @@ static gboolean bnep_setup_cb(GIOChannel *chan, GIOCondition cond,
struct bnep_control_rsp *rsp;
struct timeval timeo;
char pkt[BNEP_MTU];
- gsize r;
+ ssize_t r;
int sk;
const char *pdev, *uuid;
gboolean connected;
@@ -208,21 +208,23 @@ static gboolean bnep_setup_cb(GIOChannel *chan, GIOCondition cond,
goto failed;
}
+ sk = g_io_channel_unix_get_fd(chan);
+
memset(pkt, 0, BNEP_MTU);
- if (g_io_channel_read(chan, pkt, sizeof(pkt) - 1,
- &r) != G_IO_ERROR_NONE) {
+ r = read(sk, pkt, sizeof(pkt) -1);
+ if (r < 0) {
error("IO Channel read error");
goto failed;
}
- if (r <= 0) {
+ if (r == 0) {
error("No packet received on l2cap socket");
goto failed;
}
errno = EPROTO;
- if (r < sizeof(*rsp)) {
+ if ((size_t) r < sizeof(*rsp)) {
error("Packet received is not bnep type");
goto failed;
}
@@ -243,8 +245,6 @@ static gboolean bnep_setup_cb(GIOChannel *chan, GIOCondition cond,
goto failed;
}
- sk = g_io_channel_unix_get_fd(chan);
-
memset(&timeo, 0, sizeof(timeo));
timeo.tv_sec = 0;