diff options
author | Bastien Nocera <hadess@hadess.net> | 2015-02-05 15:17:36 +0100 |
---|---|---|
committer | Bastien Nocera <hadess@hadess.net> | 2015-02-05 15:17:36 +0100 |
commit | 440a4c6b864de477844eaae83dba3c3886e0e64f (patch) | |
tree | 49e5a3d620a2cd9fff853836ddfed2897374abce | |
parent | ff81cd492349af264439601d64b5a8c1cc8330f5 (diff) | |
download | shared-mime-info-440a4c6b864de477844eaae83dba3c3886e0e64f.tar.gz |
Fix warning when compiling without fdatasync support
https://bugs.freedesktop.org/show_bug.cgi?id=74872
-rw-r--r-- | update-mime-database.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/update-mime-database.c b/update-mime-database.c index be4aba25..81d98952 100644 --- a/update-mime-database.c +++ b/update-mime-database.c @@ -937,6 +937,7 @@ set_error_from_errno (GError **error) g_strerror(errsv)); } +#ifdef HAVE_FDATASYNC static gboolean sync_enabled(void) { @@ -947,16 +948,17 @@ sync_enabled(void) return TRUE; return atoi(env); } +#endif static int sync_file(const gchar *pathname, GError **error) { +#ifdef HAVE_FDATASYNC int fd; if (!sync_enabled()) return 0; -#ifdef HAVE_FDATASYNC fd = open(pathname, O_RDWR); if (fd == -1) { |