Hi Bastien, On Tue, Jul 19, 2011 at 2:26 PM, Luiz Augusto von Dentz <luiz.dentz@xxxxxxxxx> wrote: > Hi Bastien, > > Apparently there is something wrong when removing last adapter > bluetoothd start burning cpu, disabling adaptername fix the problem so > there might be something wrong in adapter remove callback, can you > take a look? Btw, Im using rawhide so I suppose adaptername should > work, right? It seems .remove is closing and removing the watch for every adapter but the watch is initialized in the plugin init so it is not really per-adapter, so I moved to .exit: diff --git a/plugins/adaptername.c b/plugins/adaptername.c index 2a54cc0..9e99e6a 100644 --- a/plugins/adaptername.c +++ b/plugins/adaptername.c @@ -262,10 +262,6 @@ static gboolean handle_inotify_cb(GIOChannel *channel, GIOCondition cond, static void adaptername_remove(struct btd_adapter *adapter) { - if (watch_fd >= 0) - close(watch_fd); - if (inotify != NULL) - g_io_channel_shutdown(inotify, FALSE, NULL); } static struct btd_adapter_driver adaptername_driver = { @@ -314,6 +310,13 @@ static int adaptername_init(void) static void adaptername_exit(void) { + if (watch_fd >= 0) + close(watch_fd); + if (inotify != NULL) { + g_io_channel_shutdown(inotify, FALSE, NULL); + g_io_channel_unref(inotify); + } + btd_unregister_adapter_driver(&adaptername_driver); } It seems to work fine. -- Luiz Augusto von Dentz -- 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