From 817e1ec9015d16ab6520cbb7e076d1e507c8ad67 Mon Sep 17 00:00:00 2001 From: Kevin Lo Date: Tue, 11 Sep 2007 01:59:00 +0000 Subject: [PATCH] Check return value of listen(). Reviewed by: emax Approved by: re (kensmith) --- usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c b/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c index 4c37d5f073e..deffb2ea297 100644 --- a/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c +++ b/usr.bin/bluetooth/rfcomm_sppd/rfcomm_sppd.c @@ -211,7 +211,8 @@ main(int argc, char *argv[]) if (bind(acceptsock, (struct sockaddr *)&ma, sizeof(ma)) < 0) err(1, "Could not bind socket -- channel %d in use?", channel); - listen(acceptsock, 10); + if (listen(acceptsock, 10) != 0) + err(1, "Could not listen on socket"); ss = sdp_open_local(NULL); if (ss == NULL)