- when there is no monitor running, don't crash. just exit. it's nicer.

issue found in budapest, but the spa made me forget about it.

ok ajacoutot@
This commit is contained in:
jasper 2009-10-28 20:28:18 +00:00
parent 9c85c61df8
commit 20e7f10120
2 changed files with 35 additions and 2 deletions

View File

@ -1,4 +1,4 @@
# $OpenBSD: Makefile,v 1.17 2009/10/14 09:26:58 ajacoutot Exp $
# $OpenBSD: Makefile,v 1.18 2009/10/28 20:28:18 jasper Exp $
COMMENT= powerful desktop search tool and indexer
@ -6,7 +6,7 @@ COMMENT= powerful desktop search tool and indexer
# as tracker-search.
GNOME_PROJECT= tracker
GNOME_VERSION= 0.6.95
PKGNAME= tracker-search-${VERSION}p1
PKGNAME= tracker-search-${VERSION}p2
SHARED_LIBS += stemmer 0.1 # .695.0
SHARED_LIBS += tracker-common 0.1 # .695.0

View File

@ -0,0 +1,33 @@
$OpenBSD: patch-src_trackerd_tracker-monitor_c,v 1.1 2009/10/28 20:28:18 jasper Exp $
Fix a segfault where there is no monitor running.
--- src/trackerd/tracker-monitor.c.orig Sun Apr 26 12:22:58 2009
+++ src/trackerd/tracker-monitor.c Wed Oct 28 21:06:25 2009
@@ -208,6 +208,7 @@ tracker_monitor_init (TrackerMonitor *object)
GFileMonitor *monitor;
GList *all_modules, *l;
const gchar *name;
+ GError *error = NULL;
object->private = TRACKER_MONITOR_GET_PRIVATE (object);
@@ -276,7 +277,17 @@ tracker_monitor_init (TrackerMonitor *object)
monitor = g_file_monitor_directory (file,
G_FILE_MONITOR_WATCH_MOUNTS,
NULL,
- NULL);
+ &error);
+
+ /* Directory monitoring is missing, error out, don't crash. */
+ if (error) {
+ g_critical ("Could not obtain monitor: %s", error->message);
+ g_error_free (error);
+
+ exit (EXIT_FAILURE);
+ return FALSE;
+ }
+
priv->monitor_backend = G_OBJECT_TYPE (monitor);