Diff between 48371157e1471c64d69caf205c5ed55b96638871 and acc35edff7588e97453440b41e477359d2d8f073

Changed Files

File Additions Deletions Status
src/hcid.h +0 -3 modified
src/main.c +4 -56 modified
src/manager.c +0 -7 modified

Full Patch

diff --git a/src/hcid.h b/src/hcid.h
index 43a75fd..bfbe821 100644
--- a/src/hcid.h
+++ b/src/hcid.h
@@ -53,9 +53,6 @@ enum {
 
 extern struct main_opts main_opts;
 
-void btd_start_exit_timer(void);
-void btd_stop_exit_timer(void);
-
 gboolean plugin_init(GKeyFile *config, const char *enable,
 							const char *disable);
 void plugin_cleanup(void);
diff --git a/src/main.c b/src/main.c
index 78e60c3..0b2809a 100644
--- a/src/main.c
+++ b/src/main.c
@@ -342,7 +342,6 @@ static gchar *option_plugin = NULL;
 static gchar *option_noplugin = NULL;
 static gboolean option_detach = TRUE;
 static gboolean option_version = FALSE;
-static gboolean option_udev = FALSE;
 
 static void free_options(void)
 {
@@ -356,36 +355,6 @@ static void free_options(void)
 	option_noplugin = NULL;
 }
 
-static guint last_adapter_timeout = 0;
-
-static gboolean exit_timeout(gpointer data)
-{
-	g_main_loop_quit(event_loop);
-	last_adapter_timeout = 0;
-	return FALSE;
-}
-
-void btd_start_exit_timer(void)
-{
-	if (option_udev == FALSE)
-		return;
-
-	if (last_adapter_timeout > 0)
-		g_source_remove(last_adapter_timeout);
-
-	last_adapter_timeout = g_timeout_add_seconds(LAST_ADAPTER_EXIT_TIMEOUT,
-						exit_timeout, NULL);
-}
-
-void btd_stop_exit_timer(void)
-{
-	if (last_adapter_timeout == 0)
-		return;
-
-	g_source_remove(last_adapter_timeout);
-	last_adapter_timeout = 0;
-}
-
 static void disconnect_dbus(void)
 {
 	DBusConnection *conn = btd_get_dbus_connection();
@@ -454,8 +423,6 @@ static GOptionEntry options[] = {
 				"Don't run as daemon in background" },
 	{ "version", 'v', 0, G_OPTION_ARG_NONE, &option_version,
 				"Show version information and exit" },
-	{ "udev", 'u', 0, G_OPTION_ARG_NONE, &option_udev,
-				"Run from udev mode of operation" },
 	{ NULL },
 };
 
@@ -489,19 +456,7 @@ int main(int argc, char *argv[])
 		exit(0);
 	}
 
-	if (option_udev == TRUE) {
-		int err;
-
-		option_detach = TRUE;
-		err = connect_dbus();
-		if (err < 0) {
-			if (err == -EALREADY)
-				exit(0);
-			exit(1);
-		}
-	}
-
-	if (option_detach == TRUE && option_udev == FALSE) {
+	if (option_detach == TRUE) {
 		if (daemon(0, 0)) {
 			perror("Can't start daemon");
 			exit(1);
@@ -520,16 +475,9 @@ int main(int argc, char *argv[])
 
 	parse_config(config);
 
-	if (option_udev == FALSE) {
-		if (connect_dbus() < 0) {
-			error("Unable to get on D-Bus");
-			exit(1);
-		}
-	} else {
-		if (daemon(0, 0)) {
-			perror("Can't start daemon");
-			exit(1);
-		}
+	if (connect_dbus() < 0) {
+		error("Unable to get on D-Bus");
+		exit(1);
 	}
 
 	if (!manager_init("/")) {
diff --git a/src/manager.c b/src/manager.c
index bc10f32..d3e1e45 100644
--- a/src/manager.c
+++ b/src/manager.c
@@ -88,9 +88,6 @@ static void manager_remove_adapter(struct btd_adapter *adapter)
 
 	adapter_remove(adapter);
 	btd_adapter_unref(adapter);
-
-	if (adapters == NULL)
-		btd_start_exit_timer();
 }
 
 void manager_cleanup(const char *path)
@@ -104,8 +101,6 @@ void manager_cleanup(const char *path)
 		adapters = g_slist_remove(adapters, adapter);
 		btd_adapter_unref(adapter);
 	}
-
-	btd_start_exit_timer();
 }
 
 static gint adapter_id_cmp(gconstpointer a, gconstpointer b)
@@ -183,8 +178,6 @@ struct btd_adapter *btd_manager_register_adapter(int id, gboolean up)
 
 	path = adapter_get_path(adapter);
 
-	btd_stop_exit_timer();
-
 	if (default_adapter_id < 0)
 		manager_set_default_adapter(id);