[PATCH] Check whether Beagle daemon is running



If e.g. a crashed Beagle daemon leaves a stale lock file, nautilus'
search feature tries to connect to the daemon and fails. It fails too
late, though, to fallback to the simple search engine. The attached
patch adds an additional check before initializing the Beagle search
engine, so it can properly fallback to the simple search engine.

Ok to commit?

Jürg
Index: ChangeLog
===================================================================
RCS file: /cvs/gnome/nautilus/ChangeLog,v
retrieving revision 1.6897
diff -p -u -r1.6897 ChangeLog
--- ChangeLog	11 Jul 2006 22:21:14 -0000	1.6897
+++ ChangeLog	18 Jul 2006 20:38:10 -0000
@@ -1,3 +1,10 @@
+2006-07-18  Jürg Billeter  <j bitron ch>
+
+	* libnautilus-private/nautilus-search-engine-beagle.c:
+	(nautilus_search_engine_beagle_new): check whether daemon is
+	running as beagle_client_new doesn't fail when a stale socket
+	file exists
+
 2006-07-11  Martin Wehner  <martin wehner gmail com>
 
 	* configure.in:
Index: libnautilus-private/nautilus-search-engine-beagle.c
===================================================================
RCS file: /cvs/gnome/nautilus/libnautilus-private/nautilus-search-engine-beagle.c,v
retrieving revision 1.2
diff -p -u -r1.2 nautilus-search-engine-beagle.c
--- libnautilus-private/nautilus-search-engine-beagle.c	12 Dec 2005 16:59:10 -0000	1.2
+++ libnautilus-private/nautilus-search-engine-beagle.c	18 Jul 2006 20:38:10 -0000
@@ -274,6 +274,12 @@ nautilus_search_engine_beagle_new (void)
 {
 	NautilusSearchEngineBeagle *engine;
 	BeagleClient *client;
+	
+	if (!beagle_util_daemon_is_running ()) {
+		/* check whether daemon is running as beagle_client_new
+		 * doesn't fail when a stale socket file exists */
+		return NULL;
+	}
 
 	client = beagle_client_new (NULL);
 


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