[vlc-devel] commit: config: Use fsync on Snow Leopard. (Pierre d'Herbemont )
git version control
git at videolan.org
Thu Dec 17 20:47:32 CET 2009
vlc | branch: master | Pierre d'Herbemont <pdherbemont at free.fr> | Thu Dec 17 20:44:24 2009 +0100| [f91c76f9c59dfa50514e63f8ad1c8857f65cadee] | committer: Pierre d'Herbemont
config: Use fsync on Snow Leopard.
fdatasync is not exported. Fallback on fsync.
> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=f91c76f9c59dfa50514e63f8ad1c8857f65cadee
---
src/config/file.c | 4 ++++
1 files changed, 4 insertions(+), 0 deletions(-)
diff --git a/src/config/file.c b/src/config/file.c
index 60c2cf0..db1128d 100644
--- a/src/config/file.c
+++ b/src/config/file.c
@@ -685,7 +685,11 @@ static int SaveConfigFile( vlc_object_t *p_this, const char *psz_module_name,
*/
fflush (file); /* Flush from run-time */
#ifndef WIN32
+#ifdef __APPLE__
+ fsync (fd); /* Flush from OS */
+#else
fdatasync (fd); /* Flush from OS */
+#endif
/* Atomically replace the file... */
if (utf8_rename (temporary, permanent))
utf8_unlink (temporary);
More information about the vlc-devel
mailing list