[tracker/o_noatime: 7/12] tracker-extract, gif: Open GIF files with O_NOATIME



commit d330809e090766c26e345aea8471a71f9efb78f0
Author: Philip Van Hoof <philip codeminded be>
Date:   Wed Sep 21 17:50:40 2011 +0200

    tracker-extract, gif: Open GIF files with O_NOATIME

 src/tracker-extract/tracker-extract-gif.c |   13 ++++++++++++-
 1 files changed, 12 insertions(+), 1 deletions(-)
---
diff --git a/src/tracker-extract/tracker-extract-gif.c b/src/tracker-extract/tracker-extract-gif.c
index 5073509..982dc74 100644
--- a/src/tracker-extract/tracker-extract-gif.c
+++ b/src/tracker-extract/tracker-extract-gif.c
@@ -584,6 +584,8 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
 	const gchar *graph;
 	gchar *filename, *uri;
 	GFile *file;
+	FILE *f;
+	int fd;
 
 	preupdate = tracker_extract_info_get_preupdate_builder (info);
 	metadata = tracker_extract_info_get_metadata_builder (info);
@@ -598,7 +600,14 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
 		return FALSE;
 	}
 
-	if ((gifFile = DGifOpenFileName (filename)) == NULL) {
+	f = tracker_file_open (filename);
+	if (!f) {
+		return FALSE;
+	}
+
+	fd = fileno (f);
+
+	if ((gifFile = DGifOpenFileHandle (fd)) == NULL) {
 		PrintGifError ();
 		return FALSE;
 	}
@@ -622,5 +631,7 @@ tracker_extract_get_metadata (TrackerExtractInfo *info)
 		PrintGifError ();
 	}
 
+	tracker_file_close (f, FALSE);
+
 	return TRUE;
 }



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