[tracker] libtracker-data: Report out of space errors with a separate error code



commit 801ccbb48fef43e3272906270aa0f60d494979cd
Author: Philip Van Hoof <philip codeminded be>
Date:   Wed Feb 9 12:06:15 2011 +0100

    libtracker-data: Report out of space errors with a separate error code

 src/libtracker-data/tracker-db-interface-sqlite.c |   14 +++++++++-----
 1 files changed, 9 insertions(+), 5 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-interface-sqlite.c b/src/libtracker-data/tracker-db-interface-sqlite.c
index 6b5a8de..8be803a 100644
--- a/src/libtracker-data/tracker-db-interface-sqlite.c
+++ b/src/libtracker-data/tracker-db-interface-sqlite.c
@@ -1108,9 +1108,10 @@ execute_stmt (TrackerDBInterface  *interface,
 		g_atomic_int_add (&interface->n_active_cursors, -1);
 
 		/* This is rather fatal */
-		if (sqlite3_errcode (interface->db) == SQLITE_IOERR ||
-		    sqlite3_errcode (interface->db) == SQLITE_CORRUPT ||
-		    sqlite3_errcode (interface->db) == SQLITE_NOTADB) {
+		if (errno != ENOSPC &&
+		    (sqlite3_errcode (interface->db) == SQLITE_IOERR ||
+		     sqlite3_errcode (interface->db) == SQLITE_CORRUPT ||
+		     sqlite3_errcode (interface->db) == SQLITE_NOTADB)) {
 
 			g_critical ("SQLite error: %s (errno: %s)",
 			            sqlite3_errmsg (interface->db),
@@ -1145,8 +1146,11 @@ execute_stmt (TrackerDBInterface  *interface,
 				g_set_error (error,
 				             TRACKER_DB_INTERFACE_ERROR,
 				             TRACKER_DB_QUERY_ERROR,
-				             "%s",
-				             sqlite3_errmsg (interface->db));
+				             "%s%s%s%s",
+				             sqlite3_errmsg (interface->db),
+				             errno != 0 ? " (" : "",
+				             errno != 0 ? g_strerror (errno) : "",
+				             errno != 0 ? ")" : "");
 			}
 		}
 	}



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