[tracker/error-handling: 1/10] libtracker-data: Use fstat to query size of open journal file
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/error-handling: 1/10] libtracker-data: Use fstat to query size of open journal file
- Date: Tue, 17 May 2011 15:14:44 +0000 (UTC)
commit 16484b391a703410cb039a6bb1c056c5ca729cf4
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]