static guint sco_watch = 0;
static GSList *drivers = 0;
static ofono_bool_t has_wideband = FALSE;
+static int defer_setup = 1;
static void send_new_connection(const char *card, int fd, uint8_t codec)
{
{
GIOChannel *sco_io;
struct sockaddr_sco saddr;
- int sk, defer_setup = 1;
+ int sk;
sk = socket(PF_BLUETOOTH, SOCK_SEQPACKET | O_NONBLOCK | SOCK_CLOEXEC,
BTPROTO_SCO);
}
if (setsockopt(sk, SOL_BLUETOOTH, BT_DEFER_SETUP,
- &defer_setup, sizeof(defer_setup)) < 0)
+ &defer_setup, sizeof(defer_setup)) < 0) {
+ defer_setup = 0;
ofono_warn("Can't enable deferred setup: %s (%d)",
strerror(errno), errno);
+ }
if (listen(sk, 5) < 0) {
close(sk);