Re: [PATCH v10 4/6] dbusoob: Set device name in device object

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

 



Hi Szymon,

On Wed, Oct 31, 2012, Szymon Janc wrote:
> > --- a/plugins/dbusoob.c
> > +++ b/plugins/dbusoob.c
> > @@ -193,6 +193,7 @@ static gboolean parse_data(DBusMessageIter *data, struct oob_data *remote_data)
> >  
> >  static gboolean store_data(struct btd_adapter *adapter, struct oob_data *data)
> >  {
> > +	bdaddr_t local = *adapter_get_address(adapter);
> >  	bdaddr_t bdaddr;
> >  
> >  	str2ba(data->addr, &bdaddr);
> > @@ -207,9 +208,13 @@ static gboolean store_data(struct btd_adapter *adapter, struct oob_data *data)
> >  		write_remote_class(adapter_get_address(adapter), &bdaddr,
> >  								data->class);
> >  
> > -	if (data->name)
> > -		write_device_name(adapter_get_address(adapter), &bdaddr, 0,
> > -								data->name);
> > +	if (data->name) {
> > +		char *str;
> > +
> > +		str = g_strdup(data->name);
> > +		btd_event_remote_name(&local, &bdaddr, str);
> > +		g_free(str);
> 
> Is this g_strdup needed? Why not just pass data->name directly?

This was because of missing const declarations in the event.h API. I
fixed this up and removed the extra strdup from this patch.

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