Fix SCO connection error propagation

This commit is contained in:
Johan Hedberg 2010-03-22 13:07:23 +02:00
parent 4ebb87203d
commit fa2686f9bf

View File

@ -574,10 +574,14 @@ static void sco_connect_cb(GIOChannel *chan, GError *err, gpointer user_data)
if (err) {
error("%s", err->message);
if (p && p->msg)
error_connection_attempt_failed(dev->conn, p->msg, p->err);
pending_connect_finalize(dev);
if (p != NULL) {
p->err = -errno;
if (p->msg)
error_connection_attempt_failed(dev->conn,
p->msg,
p->err);
pending_connect_finalize(dev);
}
if (hs->rfcomm)
headset_set_state(dev, HEADSET_STATE_CONNECTED);