From 2482987719d159444b20328c98ad5e2eb61747b3 Mon Sep 17 00:00:00 2001 From: Suchang Woo Date: Wed, 25 Feb 2015 16:08:33 +0900 Subject: [PATCH] Workaround for infinite loop issue When Buxton daemon is terminated unexpectedly, a daemon or an application using vconf-buxton API can fall into infinite loop. Signed-off-by: Suchang Woo Change-Id: Ib65f6224e0645db2c765bbcaa51166763c7fcf62 --- src/vconf-buxton.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/src/vconf-buxton.c b/src/vconf-buxton.c index 3d9b196..ea6a232 100644 --- a/src/vconf-buxton.c +++ b/src/vconf-buxton.c @@ -528,6 +528,10 @@ _handle_buxton_response_ (int lock) result = buxton_client_handle_response (_buxton_ ()); if (result < 0) ERR ("Error in buxton_client_handle_response: %m"); + if (result == 0) { + ERR ("Connection closed"); + result = -1; + } if (lock) UNLOCK (buxton); return result; @@ -1153,7 +1157,13 @@ _notify_reg_unreg_ (struct notify *notif, bool reg) static gboolean _cb_glib_ (GIOChannel * src, GIOCondition cond, gpointer data) { - _handle_buxton_response_ (1); + int status; + + status = _handle_buxton_response_ (1); + if (status < 0) { + glib_source = NULL; + return G_SOURCE_REMOVE; + } return G_SOURCE_CONTINUE; } -- 2.7.4