[PATCH] Fix a GLib-Warning in adaptername plugin.

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

 



A -GLib-WARNING **: Invalid file descriptor.- was showed when the
bluetooth daemon is killed.
---
 plugins/adaptername.c |    9 +++++++--
 1 files changed, 7 insertions(+), 2 deletions(-)

diff --git a/plugins/adaptername.c b/plugins/adaptername.c
index 2a54cc0..a7ebf37 100644
--- a/plugins/adaptername.c
+++ b/plugins/adaptername.c
@@ -262,10 +262,15 @@ static gboolean handle_inotify_cb(GIOChannel *channel, GIOCondition cond,
 
 static void adaptername_remove(struct btd_adapter *adapter)
 {
-	if (watch_fd >= 0)
+	if (watch_fd >= 0) {
 		close(watch_fd);
-	if (inotify != NULL)
+		watch_fd = -1;
+	}
+	if (inotify != NULL) {
 		g_io_channel_shutdown(inotify, FALSE, NULL);
+		g_io_channel_unref(inotify);
+		inotify = NULL;
+	}
 }
 
 static struct btd_adapter_driver adaptername_driver = {
-- 
1.7.4.1

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