Re: [PATCH v3 03/10] adaptername: Retrieve config name from adapter

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

 



Hi Fred,

> Retrieve saved config name using adapter_get_config_name() instead
> of reading it from storage file.
> ---
>  plugins/adaptername.c |    9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 
> diff --git a/plugins/adaptername.c b/plugins/adaptername.c
> index f58fb0f..46dbbe8 100644
> --- a/plugins/adaptername.c
> +++ b/plugins/adaptername.c
> @@ -198,7 +198,8 @@ static void set_pretty_name(struct btd_adapter *adapter,
>  static int adaptername_probe(struct btd_adapter *adapter)
>  {
>  	int current_id;
> -	char name[MAX_NAME_LENGTH + 1];
> +	char *name;
> +	char str[MAX_NAME_LENGTH + 1];
>  	char *pretty_hostname;
>  
>  	pretty_hostname = read_pretty_host_name();
> @@ -211,8 +212,10 @@ static int adaptername_probe(struct btd_adapter *adapter)
>  	adapter_set_allow_name_changes(adapter, TRUE);
>  	current_id = adapter_get_dev_id(adapter);
>  
> -	if (read_local_name(adapter_get_address(adapter), name) < 0)
> -		expand_name(name, MAX_NAME_LENGTH, main_opts.name, current_id);
> +	if (adapter_get_config_name(adapter, &name) < 0) {
> +		expand_name(str, MAX_NAME_LENGTH, main_opts.name, current_id);
> +		name = str;
> +	}

fair enough, you are using it here. And even why you have this as a
separate config. However this is a bit messed up.

If we have a name configured we should use that. Only a not configured
system should allow a name change here. And reading a main_opts.name
from a plugin is also bad. This needs some further investigation.

Regards

Marcel


--
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