Re: [PATCH 1/3] Add return value to reply_list_foreach_t in phonebook-tracker

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

 



Hi Radek,

On Mon, Feb 07, 2011, Radoslaw Jablonski wrote:
> +	return -1;

Could you please use some more meaningful POSIX error codes here,
-EINVAL, etc.

> @@ -1645,13 +1652,14 @@ fail:
>  	g_free(temp_id);
>  	temp_id = NULL;
>  
> +	return -1;

Same here.

>  done:
>  	if (num_fields <= 0)
>  		data->ready_cb(data->user_data);
>  
> +	return -1;

And here.

>  	if (num_fields < 0) {
>  		data->cb(NULL, 0, num_fields, 0, data->user_data);
> -		return;
> +		return -1;

And here.

>  	}
>  
>  	if (data->params->maxlistcount == 0) {
> @@ -1880,6 +1889,8 @@ done:
>  	query_tracker(query, col_amount, pull_cb, data, &err);
>  	if (err < 0)
>  		data->cb(NULL, 0, err, 0, data->user_data);
> +
> +	return -1;
>  }

This looks a bit strange. Is it really a failure even if err is 0? I'd
expect the return statement to look like "return err;". Btw, why doesn't
query_tracker return the error in its return value?

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