diff --git a/src/hcid.h b/src/hcid.h
index 43a75fd..bfbe821 100644
--- a/src/hcid.h
+++ b/src/hcid.h
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
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)
{
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();
"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 },
};
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);
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
adapter_remove(adapter);
btd_adapter_unref(adapter);
-
- if (adapters == NULL)
- btd_start_exit_timer();
}
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)
path = adapter_get_path(adapter);
- btd_stop_exit_timer();
-
if (default_adapter_id < 0)
manager_set_default_adapter(id);