[tracker] libtracker-common: Use statfs instead of statvfs on Linux
- From: Jürg Billeter <juergbi src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [tracker] libtracker-common: Use statfs instead of statvfs on Linux
- Date: Mon, 17 Jan 2011 09:19:35 +0000 (UTC)
commit 762c6a5c13ac6696d890f9bd008c7e4de4eaea94
Author: Jürg Billeter <j bitron ch>
Date: Fri Jan 14 17:27:18 2011 +0100
libtracker-common: Use statfs instead of statvfs on Linux
statfs is more efficient and we do not need the extra information
returned by statvfs.
Fixes NB#219309.
src/libtracker-common/tracker-file-utils.c | 16 ++++++++++++++++
1 files changed, 16 insertions(+), 0 deletions(-)
---
diff --git a/src/libtracker-common/tracker-file-utils.c b/src/libtracker-common/tracker-file-utils.c
index 2ee5355..122142d 100644
--- a/src/libtracker-common/tracker-file-utils.c
+++ b/src/libtracker-common/tracker-file-utils.c
@@ -34,6 +34,10 @@
#include <limits.h>
#include <errno.h>
+#ifdef __linux__
+#include <sys/statfs.h>
+#endif
+
#include <glib.h>
#include <gio/gio.h>
@@ -191,12 +195,24 @@ tracker_file_get_mime_type (GFile *file)
return content_type ? content_type : g_strdup ("unknown");
}
+#ifdef __linux__
+
+#ifdef __USE_LARGEFILE64
+#define __statvfs statfs64
+#else
+#define __statvfs statfs
+#endif
+
+#else /* __linux__ */
+
#if HAVE_STATVFS64
#define __statvfs statvfs64
#else
#define __statvfs statvfs
#endif
+#endif /* __linux__ */
+
guint64
tracker_file_system_get_remaining_space (const gchar *path)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]