handsfree-audio: Don't listen() if no defer_setup

As we won't allow any card to be registered when the kernel doesn't
support defer_setup, we don't need to have the listening SCO socket
open in this case.
This commit is contained in:
Vinicius Costa Gomes 2013-09-10 21:09:44 -03:00 committed by Denis Kenzior
parent 6d08a47ec3
commit 51982e7b13
1 changed files with 3 additions and 0 deletions

View File

@ -214,9 +214,12 @@ static int sco_init(void)
if (setsockopt(sk, SOL_BLUETOOTH, BT_DEFER_SETUP,
&defer_setup, sizeof(defer_setup)) < 0) {
int err = -errno;
defer_setup = 0;
ofono_warn("Can't enable deferred setup: %s (%d)",
strerror(errno), errno);
close(sk);
return err;
}
memset(&voice, 0, sizeof(voice));