Skip to content

Commit

Permalink
Suggest stopping the bluetooth service in case bind returns EADDRINUSE.
Browse files Browse the repository at this point in the history
  • Loading branch information
Matlo committed Jul 17, 2014
1 parent 5e30e84 commit 1a41beb
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion core/connectors/l2cap_con.c
Original file line number Diff line number Diff line change
Expand Up @@ -335,7 +335,15 @@ int l2cap_listen(unsigned short psm, int options)

if(bind(s, (struct sockaddr *) &loc_addr, sizeof(loc_addr)) < 0)
{
perror("bind");
if(errno == EADDRINUSE)
{
fprintf(stderr, "bind: Address already in use\n");
fprintf(stderr, "please stop the bluetooth service\n");
}
else
{
perror("bind");
}
close(s);
return -1;
}
Expand Down

0 comments on commit 1a41beb

Please sign in to comment.