[tracker/error-handling: 6/10] libtracker-data: If unable to writer journal header, delete empty file
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/error-handling: 6/10] libtracker-data: If unable to writer journal header, delete empty file
- Date: Tue, 17 May 2011 15:15:09 +0000 (UTC)
commit 0ddddd21ec6e7bd88f0decf90b0b367122d6289b
Author: Jürg Billeter <j bitron ch>
Date: Tue May 17 15:21:49 2011 +0200
libtracker-data: If unable to writer journal header, delete empty file
src/libtracker-data/tracker-db-journal.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-data/tracker-db-journal.c b/src/libtracker-data/tracker-db-journal.c
index 4d6ce74..fc5956a 100644
--- a/src/libtracker-data/tracker-db-journal.c
+++ b/src/libtracker-data/tracker-db-journal.c
@@ -495,6 +495,11 @@ db_journal_init_file (JournalWriter *jwriter,
jwriter->cur_block[7] = '4';
if (!write_all_data (jwriter->journal, jwriter->cur_block, 8, error)) {
+ cur_block_kill (jwriter);
+ /* delete empty journal file */
+ g_unlink (jwriter->journal_filename);
+ close (jwriter->journal);
+ jwriter->journal = 0;
return FALSE;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]