From: Johan Hedberg <johan.hedberg@gmail.com>
To: Anderson Lizardo <anderson.lizardo@openbossa.org>
Cc: Claudio Takahasi <claudio.takahasi@openbossa.org>,
linux-bluetooth@vger.kernel.org,
Paulo Alcantara <paulo.alcantara@openbossa.org>
Subject: Re: [PATCH BlueZ] btio: Rescue lost errorneous numbers
Date: Tue, 24 Jul 2012 11:54:49 +0200 [thread overview]
Message-ID: <20120724095449.GD9576@x220.ice.intel.com> (raw)
In-Reply-To: <CAJdJm_N7Z4a2p7-Ur+_kEf2Q==aL5QTYpmnRomX+LXjy1Dd37Q@mail.gmail.com>
Hi Lizardo,
On Mon, Jul 23, 2012, Anderson Lizardo wrote:
> On Mon, Jul 23, 2012 at 10:36 AM, Claudio Takahasi
> <claudio.takahasi@openbossa.org> wrote:
> > #define ERROR_FAILED(gerr, str, err) \
> > - g_set_error(gerr, BT_IO_ERROR, BT_IO_ERROR_FAILED, \
> > + g_set_error(gerr, BT_IO_ERROR, err, \
> > str ": %s (%d)", strerror(err), err)
> > [...]
> > if (err < 0)
> > - g_set_error(&gerr, BT_IO_ERROR,
> > - BT_IO_ERROR_CONNECT_FAILED, "%s (%d)",
> > - strerror(-err), -err);
> > - } else if (cond & (G_IO_HUP | G_IO_ERR))
> > - g_set_error(&gerr, BT_IO_ERROR, BT_IO_ERROR_CONNECT_FAILED,
> > - "HUP or ERR on socket");
> > + g_set_error(&gerr, BT_IO_ERROR, -err, "%s (%d)",
> > + strerror(-err), -err);
>
> why not use the ERROR_FAILED() macro here?
>
> > if (err < 0) {
> > - g_set_error(gerr, BT_IO_ERROR, BT_IO_ERROR_CONNECT_FAILED,
> > - "connect: %s (%d)", strerror(-err), -err);
> > + g_set_error(gerr, BT_IO_ERROR, -err, "connect: %s (%d)",
> > + strerror(-err), -err);
>
> and here?
Good point. Unfortunately I didn't notice this before applying so please
(Claudio) send a fix on top of your patch.
Johan
next prev parent reply other threads:[~2012-07-24 9:54 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-07-23 14:36 [PATCH BlueZ] attio: Rename att_cleanup to attio_cleanup Claudio Takahasi
2012-07-23 14:36 ` [PATCH BlueZ] btio: Rescue lost errorneous numbers Claudio Takahasi
2012-07-23 16:16 ` Anderson Lizardo
2012-07-24 9:54 ` Johan Hedberg [this message]
2012-07-24 13:39 ` Claudio Takahasi
2012-07-24 9:49 ` Johan Hedberg
2012-07-24 9:49 ` [PATCH BlueZ] attio: Rename att_cleanup to attio_cleanup 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=20120724095449.GD9576@x220.ice.intel.com \
--to=johan.hedberg@gmail.com \
--cc=anderson.lizardo@openbossa.org \
--cc=claudio.takahasi@openbossa.org \
--cc=linux-bluetooth@vger.kernel.org \
--cc=paulo.alcantara@openbossa.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.