[tracker/journal-compression-review: 12/15] Disable journal rotating when GLib not recent enough



commit 37fa546737b0f7780534d2e7f9e2d10779e1977e
Author: Philip Van Hoof <philip codeminded be>
Date:   Wed Jun 23 12:37:21 2010 +0200

    Disable journal rotating when GLib not recent enough

 src/tracker-store/tracker-main.c |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker-store/tracker-main.c b/src/tracker-store/tracker-main.c
index 6ca37a4..2115ec3 100644
--- a/src/tracker-store/tracker-main.c
+++ b/src/tracker-store/tracker-main.c
@@ -339,6 +339,7 @@ main (gint argc, gchar *argv[])
 	gsize chunk_size;
 	const gchar *rotate_to;
 	TrackerDBConfig *db_config;
+	gboolean do_rotating;
 
 	g_type_init ();
 
@@ -452,7 +453,15 @@ main (gint argc, gchar *argv[])
 	if (rotate_to[0] == '\0')
 		rotate_to = NULL;
 
-	tracker_db_journal_set_rotating ((chunk_size_mb != -1), chunk_size, rotate_to);
+	do_rotating = (chunk_size_mb != -1);
+
+	if (!GLIB_CHECK_VERSION (2, 24, 2)) {
+		if (do_rotating) {
+			g_warning ("Your GLib isn't recent enough for journal rotating to be enabled");
+			do_rotating = FALSE;
+		}
+		tracker_db_journal_set_rotating (do_rotating, chunk_size, rotate_to);
+	}
 
 	if (!tracker_data_manager_init (flags,
 	                                NULL,



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