Re: [PATCH BlueZ v2 04/13] gatttool: Use GError to propage error messages to caller

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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
--
To unsubscribe from this list: send the line "unsubscribe linux-bluetooth" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html




[Index of Archives]     [Bluez Devel]     [Linux Wireless Networking]     [Linux Wireless Personal Area Networking]     [Linux ATH6KL]     [Linux USB Devel]     [Linux Media Drivers]     [Linux Audio Users]     [Linux Kernel]     [Linux SCSI]     [Big List of Linux Books]

  Powered by Linux