[tracker/binary-log-2: 42/45] libtracker-db: Do not warn if journal does not exist



commit 49832660372703c54e788cdabb6ccce34fa43eed
Author: Jürg Billeter <j bitron ch>
Date:   Thu Jan 7 16:09:09 2010 +0100

    libtracker-db: Do not warn if journal does not exist

 src/libtracker-db/tracker-db-journal.c |    9 ++++++---
 1 files changed, 6 insertions(+), 3 deletions(-)
---
diff --git a/src/libtracker-db/tracker-db-journal.c b/src/libtracker-db/tracker-db-journal.c
index 8f287b0..16c2435 100644
--- a/src/libtracker-db/tracker-db-journal.c
+++ b/src/libtracker-db/tracker-db-journal.c
@@ -564,9 +564,12 @@ tracker_db_journal_reader_init (const gchar *filename)
 	reader.file = g_mapped_file_new (reader.filename, FALSE, &error);
 
 	if (error) {
-		g_warning ("Could not create TrackerDBJournalReader for file '%s', %s",
-		           reader.filename,
-		           error->message ? error->message : "no error given");
+		if (!g_error_matches (error, G_FILE_ERROR, G_FILE_ERROR_NOENT)) {
+			/* do not warn if the file does not exist, just return FALSE */
+			g_warning ("Could not create TrackerDBJournalReader for file '%s', %s",
+				   reader.filename,
+				   error->message ? error->message : "no error given");
+		}
 		g_error_free (error);
 		g_free (reader.filename);
 		reader.filename = NULL;



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