From: Vinicius Costa Gomes Date: Wed, 11 Sep 2013 00:09:44 +0000 (-0300) Subject: handsfree-audio: Don't listen() if no defer_setup X-Git-Tag: 1.13~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=51982e7b132bc4a203f87767861c392380367050;p=platform%2Fupstream%2Fofono.git 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. --- diff --git a/src/handsfree-audio.c b/src/handsfree-audio.c index f39c49b..ba0b435 100644 --- a/src/handsfree-audio.c +++ b/src/handsfree-audio.c @@ -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));