[tracker/direct-access: 31/85] libtracker-data: Also delete -shm and -wal files when deleting database



commit 8f19225ff35078367a41e7296b1c81056dc45712
Author: Jürg Billeter <j bitron ch>
Date:   Thu Jul 8 11:55:42 2010 +0200

    libtracker-data: Also delete -shm and -wal files when deleting database

 src/libtracker-data/tracker-db-manager.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-manager.c b/src/libtracker-data/tracker-db-manager.c
index c99811e..4c114a2 100644
--- a/src/libtracker-data/tracker-db-manager.c
+++ b/src/libtracker-data/tracker-db-manager.c
@@ -394,10 +394,20 @@ db_manager_remove_all (gboolean rm_journal)
 	 * calculate the absolute directories here.
 	 */
 	for (i = 1; i < G_N_ELEMENTS (dbs); i++) {
+		gchar *filename;
 
 		g_message ("  Removing database:'%s'",
 		           dbs[i].abs_filename);
 		g_unlink (dbs[i].abs_filename);
+
+		/* also delete shm and wal helper files */
+		filename = g_strdup_printf ("%s-shm", dbs[i].abs_filename);
+		g_unlink (filename);
+		g_free (filename);
+
+		filename = g_strdup_printf ("%s-wal", dbs[i].abs_filename);
+		g_unlink (filename);
+		g_free (filename);
 	}
 
 	if (rm_journal) {



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