linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: Re: [PATCH] Fix error not being propagated properly
Date: Fri, 5 Mar 2010 15:36:20 +0200	[thread overview]
Message-ID: <2d5a2c101003050536q61f16c12xb67a985234b3619@mail.gmail.com> (raw)
In-Reply-To: <2d5a2c101003050503j4e9bf8a0hdd91c8af4a9bb5a4@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1308 bytes --]

Now with the correct patch attached

On Fri, Mar 5, 2010 at 3:03 PM, Luiz Augusto von Dentz
<luiz.dentz@gmail.com> wrote:
> ---
>  audio/headset.c |    4 ++--
>  1 files changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/audio/headset.c b/audio/headset.c
> index 0176937..893edd0 100644
> --- a/audio/headset.c
> +++ b/audio/headset.c
> @@ -198,7 +198,7 @@ static DBusHandlerResult
> error_connection_attempt_failed(DBusConnection *conn,
>  {
>        return error_common_reply(conn, msg,
>                        ERROR_INTERFACE ".ConnectionAttemptFailed",
> -                       err > 0 ? strerror(err) : "Connection attempt failed");
> +                       err < 0 ? strerror(-err) : "Connection attempt failed");
>  }
>
>  static int rfcomm_connect(struct audio_device *device, headset_stream_cb_t cb,
> @@ -435,7 +435,7 @@ static void pending_connect_complete(struct
> connect_cb *cb, struct audio_device
>  {
>        struct headset *hs = dev->headset;
>
> -       if (hs->pending->err)
> +       if (hs->pending->err < 0)
>                cb->cb(NULL, cb->cb_data);
>        else
>                cb->cb(dev, cb->cb_data);
> --
> 1.6.3.3
>
>
> --
> Luiz Augusto von Dentz
> Computer Engineer
>



-- 
Luiz Augusto von Dentz
Computer Engineer

[-- Attachment #2: 0011-Fix-error-not-being-propagated-properly.patch --]
[-- Type: text/x-patch, Size: 1101 bytes --]

From 5dd57c233aa881faeaa6bfca147abcdb9e04dc93 Mon Sep 17 00:00:00 2001
From: Luiz Augusto Von Dentz <luiz.dentz-von@nokia.com>
Date: Fri, 5 Mar 2010 15:01:59 +0200
Subject: [PATCH 11/11] Fix error not being propagated properly

---
 audio/headset.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/audio/headset.c b/audio/headset.c
index 0176937..893edd0 100644
--- a/audio/headset.c
+++ b/audio/headset.c
@@ -198,7 +198,7 @@ static DBusHandlerResult error_connection_attempt_failed(DBusConnection *conn,
 {
 	return error_common_reply(conn, msg,
 			ERROR_INTERFACE ".ConnectionAttemptFailed",
-			err > 0 ? strerror(err) : "Connection attempt failed");
+			err < 0 ? strerror(-err) : "Connection attempt failed");
 }
 
 static int rfcomm_connect(struct audio_device *device, headset_stream_cb_t cb,
@@ -435,7 +435,7 @@ static void pending_connect_complete(struct connect_cb *cb, struct audio_device
 {
 	struct headset *hs = dev->headset;
 
-	if (hs->pending->err)
+	if (hs->pending->err < 0)
 		cb->cb(NULL, cb->cb_data);
 	else
 		cb->cb(dev, cb->cb_data);
-- 
1.6.3.3


  reply	other threads:[~2010-03-05 13:36 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-03-05 13:03 [PATCH] Fix error not being propagated properly Luiz Augusto von Dentz
2010-03-05 13:36 ` Luiz Augusto von Dentz [this message]
2010-03-22 11:11   ` Johan Hedberg

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=2d5a2c101003050536q61f16c12xb67a985234b3619@mail.gmail.com \
    --to=luiz.dentz@gmail.com \
    --cc=linux-bluetooth@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).