>>From a22fa4ea791b5555673cdb1729f8d72510fbb74f Mon Sep 17 00:00:00 2001 From: Fabien Chevalier Date: Sat, 13 Sep 2008 17:11:08 +0200 Subject: [PATCH] Error code fixes In case of socket errors, we used to return a positive value where the convention is to return negative values only --- audio/avdtp.c | 10 +++++----- 1 files changed, 5 insertions(+), 5 deletions(-) diff --git a/audio/avdtp.c b/audio/avdtp.c index 592322f..ae56910 100644 --- a/audio/avdtp.c +++ b/audio/avdtp.c @@ -1380,7 +1380,7 @@ static gboolean avdtp_parse_cmd(struct avdtp *session, debug("Received DISCOVER_CMD"); return avdtp_discover_cmd(session, (void *) header, size); case AVDTP_GET_CAPABILITIES: - debug("Received GET_CAPABILITIES_CMD"); + debug("Received GET_CAPABILITIES_CMD"); return avdtp_getcap_cmd(session, (void *) header, size); case AVDTP_SET_CONFIGURATION: debug("Received SET_CONFIGURATION_CMD"); @@ -1559,9 +1559,9 @@ static void l2cap_connect_cb(GIOChannel *chan, int err, const bdaddr_t *src, len = sizeof(l2o); if (getsockopt(sk, SOL_L2CAP, L2CAP_OPTIONS, &l2o, &len) < 0) { - err = errno; - error("getsockopt(L2CAP_OPTIONS): %s (%d)", strerror(err), - err); + err = -errno; + error("getsockopt(L2CAP_OPTIONS): %s (%d)", strerror(-err), + -err); goto failed; } @@ -1598,7 +1598,7 @@ failed: AVDTP_STATE_IDLE); session->pending_open = NULL; } else - connection_lost(session, -err); + connection_lost(session, err); return; } -- 1.5.6.5