diff options
author | Marcel Holtmann <marcel@holtmann.org> | 2013-01-05 15:29:08 -0800 |
---|---|---|
committer | Marcel Holtmann <marcel@holtmann.org> | 2013-01-05 15:29:08 -0800 |
commit | d29d258758de88d2d438631560b2ad324841f98e (patch) | |
tree | 6494946d558218fc0c5853a246ff7f8344b72d5a /plugins/hostname.c | |
parent | 5ffba5be356fd2714b3d91a7d06d5256dec1b017 (diff) | |
download | bluez-d29d258758de88d2d438631560b2ad324841f98e.tar.gz |
plugins: Use btd_adapter_get_index instead of adapter_get_dev_id
Diffstat (limited to 'plugins/hostname.c')
-rw-r--r-- | plugins/hostname.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/plugins/hostname.c b/plugins/hostname.c index daab715d7..0b75fac20 100644 --- a/plugins/hostname.c +++ b/plugins/hostname.c @@ -64,10 +64,11 @@ static void update_name(struct btd_adapter *adapter, gpointer user_data) adapter_set_name(adapter, pretty_hostname); } else { - int dev_id = adapter_get_dev_id(adapter); + uint16_t index = btd_adapter_get_index(adapter); char *str; - str = g_strdup_printf("%s #%u", pretty_hostname, dev_id + 1); + /* Avoid "some device #0" names, start at #1 */ + str = g_strdup_printf("%s #%u", pretty_hostname, index + 1); DBG("name: %s", str); |