[tracker/tracker-0.6] Fixed Sun OS build errors, patch by Xin Lai



commit 516ceff4a5123cf4d2b8e6ef98f3d9494f90a9e3
Author: Martyn Russell <martyn imendio com>
Date:   Tue Apr 14 11:24:00 2009 +0100

    Fixed Sun OS build errors, patch by Xin Lai
---
 src/libtracker-common/tracker-file-utils.c |    2 ++
 src/tracker-extract/tracker-extract-mp3.c  |    7 +++++++
 2 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/src/libtracker-common/tracker-file-utils.c b/src/libtracker-common/tracker-file-utils.c
index f47b487..9d06d7f 100644
--- a/src/libtracker-common/tracker-file-utils.c
+++ b/src/libtracker-common/tracker-file-utils.c
@@ -64,10 +64,12 @@ tracker_file_open (const gchar *uri,
 
 		fd = fileno (file);
 		
+#if defined(__linux__)
 		/* Make sure we set the NOATIME flag if we have permissions to */
 		if ((flags = fcntl (fd, F_GETFL, 0)) != -1) {
 			fcntl (fd, F_SETFL, flags | O_NOATIME);
 		}
+#endif
 
 #ifdef HAVE_POSIX_FADVISE
 		if (sequential_access) {
diff --git a/src/tracker-extract/tracker-extract-mp3.c b/src/tracker-extract/tracker-extract-mp3.c
index 8d8478f..1ec4dd1 100644
--- a/src/tracker-extract/tracker-extract-mp3.c
+++ b/src/tracker-extract/tracker-extract-mp3.c
@@ -1513,6 +1513,7 @@ extract_mp3 (const gchar *filename,
 		return;
 	}
 
+#if defined(__linux__)
 	/* Can return -1 because of O_NOATIME, so we try again after
 	 * without as a last resort. This can happen due to
 	 * permissions.
@@ -1525,6 +1526,12 @@ extract_mp3 (const gchar *filename,
 			return;
 		}
 	}
+#else
+	fd = open (filename, O_RDONLY);
+	if (fd == -1) {
+		return;
+	}
+#endif
 
 #ifdef HAVE_POSIX_FADVISE
 	posix_fadvise (fd, 0, 0, POSIX_FADV_SEQUENTIAL);



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