From 196e08df850f8b2771b1c6c38e5711ab33da7b02 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 3 Apr 2009 15:10:26 +0300 Subject: [PATCH] obexd: Don't retry tty opening on HUP This was a workaround from the start and now the issue can be taken care of on the kernel side. --- obexd/src/main.c | 5 +++++ obexd/src/obex.c | 13 +------------ obexd/src/obex.h | 1 + 3 files changed, 7 insertions(+), 12 deletions(-) diff --git a/obexd/src/main.c b/obexd/src/main.c index 9e4b6d1f1..f23356c51 100644 --- a/obexd/src/main.c +++ b/obexd/src/main.c @@ -107,6 +107,11 @@ int tty_init(int services, const gchar *root_path, return ret; } +void tty_closed(void) +{ + tty_needs_reinit = TRUE; +} + static void sig_term(int sig) { g_main_loop_quit(main_loop); diff --git a/obexd/src/obex.c b/obexd/src/obex.c index cc17b288d..e8137be04 100644 --- a/obexd/src/obex.c +++ b/obexd/src/obex.c @@ -928,17 +928,6 @@ static void obex_handle_destroy(gpointer user_data) OBEX_Cleanup(obex); } -static gboolean tty_reinit(gpointer data) -{ - struct server *server = data; - - tty_init(server->services, server->folder, server->capability, server->devnode); - - server_free(server); - - return FALSE; -} - static gboolean obex_handle_input(GIOChannel *io, GIOCondition cond, gpointer user_data) { @@ -954,7 +943,7 @@ static gboolean obex_handle_input(GIOChannel *io, os = OBEX_GetUserData(obex); if (os->server->devnode) - g_idle_add(tty_reinit, os->server); + tty_closed(); return FALSE; } diff --git a/obexd/src/obex.h b/obexd/src/obex.h index aab863a3a..021ac45d6 100644 --- a/obexd/src/obex.h +++ b/obexd/src/obex.h @@ -112,3 +112,4 @@ void server_free(struct server *server); int tty_init(gint service, const gchar *folder, const gchar *capability, const gchar *devnode); +void tty_closed(void); -- 2.47.3