summaryrefslogtreecommitdiff
path: root/src/sdpd-server.c
diff options
context:
space:
mode:
authorLuiz Augusto Von Dentz <luiz.dentz-von@nokia.com>2010-03-22 14:31:34 +0200
committerLuiz Augusto Von Dentz <luiz.dentz-von@nokia.com>2010-03-24 23:16:45 +0200
commitec98e03076f6b4508e945b6a4afb943c0e1f4800 (patch)
treed55206ad2ff18c5a9e32a61470a0228c31251363 /src/sdpd-server.c
parent2bf0e14286389430bde40885f1aa6ce51b1e8b8e (diff)
downloadbluez-ec98e03076f6b4508e945b6a4afb943c0e1f4800.tar.gz
Add missing check for listen return
Diffstat (limited to 'src/sdpd-server.c')
-rw-r--r--src/sdpd-server.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/sdpd-server.c b/src/sdpd-server.c
index a67e1487c..207bd4794 100644
--- a/src/sdpd-server.c
+++ b/src/sdpd-server.c
@@ -113,7 +113,10 @@ static int init_server(uint16_t mtu, int master, int compat)
}
}
- listen(l2cap_sock, 5);
+ if (listen(l2cap_sock, 5) < 0) {
+ error("listen: %s", strerror(errno));
+ return -1;
+ }
if (!compat) {
unix_sock = -1;
@@ -138,7 +141,10 @@ static int init_server(uint16_t mtu, int master, int compat)
return -1;
}
- listen(unix_sock, 5);
+ if (listen(unix_sock, 5) < 0) {
+ error("listen UNIX socket: %s", strerror(errno));
+ return -1;
+ }
chmod(SDP_UNIX_PATH, S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH | S_IWOTH);