[tracker/tracker-0.8] tracker-db-manager: g_open may return -1
- From: Martyn James Russell <mr src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker/tracker-0.8] tracker-db-manager: g_open may return -1
- Date: Thu, 6 May 2010 17:57:15 +0000 (UTC)
commit fa5e512ae3a57ddc4b834f686c9832edc75faaa5
Author: Carlos Garnacho <carlosg gnome org>
Date: Tue May 4 15:41:05 2010 +0200
tracker-db-manager: g_open may return -1
src/libtracker-db/tracker-db-manager.c | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
---
diff --git a/src/libtracker-db/tracker-db-manager.c b/src/libtracker-db/tracker-db-manager.c
index dc3dda3..8579cc8 100644
--- a/src/libtracker-db/tracker-db-manager.c
+++ b/src/libtracker-db/tracker-db-manager.c
@@ -871,8 +871,12 @@ tracker_db_manager_init (TrackerDBManagerFlags flags,
in_use_file = g_open (in_use_filename,
O_WRONLY | O_APPEND | O_CREAT | O_SYNC,
S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP);
- fsync (in_use_file);
- close (in_use_file);
+
+ if (in_use_file >= 0) {
+ fsync (in_use_file);
+ close (in_use_file);
+ }
+
g_free (in_use_filename);
tracker_db_manager_ensure_locale ();
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]