linux-bluetooth.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Johan Hedberg <johan.hedberg@gmail.com>
To: Alvaro Silva <alvaro.silva@openbossa.org>
Cc: linux-bluetooth@vger.kernel.org,
	Eder Ruiz Maria <eder.ruiz@openbossa.org>
Subject: Re: [PATCH BlueZ v2 04/13] gatttool: Use GError to propage error messages to caller
Date: Tue, 9 Apr 2013 23:26:54 +0900	[thread overview]
Message-ID: <20130409142654.GA8294@x220> (raw)
In-Reply-To: <1364945490-17059-5-git-send-email-alvaro.silva@openbossa.org>

Hi,

On Tue, Apr 02, 2013, Alvaro Silva wrote:
> Handle runtime errors outside gatt_connect(), using GError to propagate
> error messages to caller.
> ---
>  attrib/gatttool.c    |    6 +++++-
>  attrib/gatttool.h    |    3 ++-
>  attrib/interactive.c |   10 +++++++---
>  attrib/utils.c       |   14 +++++++-------
>  4 files changed, 21 insertions(+), 12 deletions(-)

The first three patches have been applied, but there are a few issues
with this one:

> --- a/attrib/gatttool.c
> +++ b/attrib/gatttool.c
> @@ -576,6 +576,7 @@ int main(int argc, char *argv[])
>  	if (g_option_context_parse(context, &argc, &argv, &gerr) == FALSE) {
>  		g_printerr("%s\n", gerr->message);
>  		g_error_free(gerr);
> +		gerr = NULL;

g_error_free + gerr = NULL is the same as g_clear_error(&gerr). Please
use that instead.

>  	chan = gatt_connect(opt_src, opt_dst, opt_dst_type, opt_sec_level,
> -					opt_psm, opt_mtu, connect_cb);
> +					opt_psm, opt_mtu, connect_cb, &gerr);
>  	if (chan == NULL) {
> +		g_printerr("%s\n", gerr->message);
> +		g_error_free(gerr);
> +		gerr = NULL;

Same here.

Johan

  reply	other threads:[~2013-04-09 14:26 UTC|newest]

Thread overview: 32+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-03-21 22:31 [PATCH 00/13] Improvements on gatttool interactive interface Alvaro Silva
2013-03-21 22:31 ` [PATCH 01/13] gatttool: Fix memory leak after parsing input line Alvaro Silva
2013-03-21 22:31 ` [PATCH 02/13] gatttool: Remove programming error check Alvaro Silva
2013-03-22  1:06   ` Anderson Lizardo
2013-03-21 22:31 ` [PATCH 03/13] gatttool: Remote address is mandatory for non-interactive gatttool Alvaro Silva
2013-03-21 22:31 ` [PATCH 04/13] gatttool: Use GError to propage error messages to caller Alvaro Silva
2013-03-21 22:31 ` [PATCH 05/13] gatttool: Fix issues with printf() and readline prompt Alvaro Silva
2013-03-21 22:31 ` [PATCH 06/13] gatttool: Replace more usages of printf() with rl_printf() Alvaro Silva
2013-03-21 22:31 ` [PATCH 07/13] gatttool: Use bluetoothctl behavior when pressing Enter on empty prompt Alvaro Silva
2013-03-21 22:31 ` [PATCH 08/13] gatttool: Show connection state using color Alvaro Silva
2013-03-21 22:31 ` [PATCH 09/13] gatttool: Remove connecting message from prompt Alvaro Silva
2013-03-21 22:31 ` [PATCH 10/13] gatttool: Use bluetoothctl strategy to handle standard input Alvaro Silva
2013-03-21 22:31 ` [PATCH 11/13] gatttool: Use bluetoothctl strategy for unix signal handling Alvaro Silva
2013-03-21 22:31 ` [PATCH 12/13] gatttool: Show info message when no primary service is found Alvaro Silva
2013-03-21 22:31 ` [PATCH 13/13] gatttool: Use error message prefixes consistently Alvaro Silva
2013-04-02 23:31 ` [PATCH BlueZ v2 00/13] Improvements on gatttool interactive interface Alvaro Silva
2013-04-02 23:31   ` [PATCH BlueZ v2 01/13] gatttool: Fix memory leak after parsing input line Alvaro Silva
2013-04-02 23:31   ` [PATCH BlueZ v2 02/13] gatttool: Remote address is mandatory for non-interactive gatttool Alvaro Silva
2013-04-02 23:31   ` [PATCH BlueZ v2 03/13] gatttool: Remove check for bluetooth address parameter on gatt_connect() Alvaro Silva
2013-04-02 23:31   ` [PATCH BlueZ v2 04/13] gatttool: Use GError to propage error messages to caller Alvaro Silva
2013-04-09 14:26     ` Johan Hedberg [this message]
2013-04-16 15:49     ` [PATCH BlueZ v3] " Eder Ruiz Maria
2013-04-17  8:24       ` Johan Hedberg
2013-04-02 23:31   ` [PATCH BlueZ v2 05/13] gatttool: Fix issues with printf() and readline prompt Alvaro Silva
2013-04-02 23:31   ` [PATCH BlueZ v2 06/13] gatttool: Replace more usages of printf() with rl_printf() Alvaro Silva
2013-04-02 23:31   ` [PATCH BlueZ v2 07/13] gatttool: Use bluetoothctl behavior when pressing Enter on empty prompt Alvaro Silva
2013-04-02 23:31   ` [PATCH BlueZ v2 08/13] gatttool: Show connection state using color Alvaro Silva
2013-04-02 23:31   ` [PATCH BlueZ v2 09/13] gatttool: Remove connecting message from prompt Alvaro Silva
2013-04-02 23:31   ` [PATCH BlueZ v2 10/13] gatttool: Use bluetoothctl strategy to handle standard input Alvaro Silva
2013-04-02 23:31   ` [PATCH BlueZ v2 11/13] gatttool: Use bluetoothctl strategy for unix signal handling Alvaro Silva
2013-04-02 23:31   ` [PATCH BlueZ v2 12/13] gatttool: Show info message when no primary service is found Alvaro Silva
2013-04-02 23:31   ` [PATCH BlueZ v2 13/13] gatttool: Use error message prefixes consistently Alvaro Silva

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=20130409142654.GA8294@x220 \
    --to=johan.hedberg@gmail.com \
    --cc=alvaro.silva@openbossa.org \
    --cc=eder.ruiz@openbossa.org \
    --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).