[tracker/tracker-0.10] libtracker-data: Use fstat to query size of open journal file



commit 89ce78dfab50e45a5c1728ca0fb594cdeaa4660d
Author: Jürg Billeter <j bitron ch>
Date:   Tue May 17 14:33:15 2011 +0200

    libtracker-data: Use fstat to query size of open journal file
    
    This avoids querying the size of the wrong file in the unlikely case
    that another process replaced the journal file between open and stat.

 src/libtracker-data/tracker-db-journal.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-journal.c b/src/libtracker-data/tracker-db-journal.c
index 89c6a4b..d9f9bf3 100644
--- a/src/libtracker-data/tracker-db-journal.c
+++ b/src/libtracker-data/tracker-db-journal.c
@@ -469,7 +469,7 @@ db_journal_init_file (JournalWriter  *jwriter,
 		return FALSE;
 	}
 
-	if (g_stat (jwriter->journal_filename, &st) == 0) {
+	if (fstat (jwriter->journal, &st) == 0) {
 		jwriter->cur_size = (gsize) st.st_size;
 	}
 



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