]> git.sesse.net Git - vlc/commitdiff
config: Use fsync on Snow Leopard.
authorPierre d'Herbemont <pdherbemont@free.fr>
Thu, 17 Dec 2009 19:44:24 +0000 (20:44 +0100)
committerPierre d'Herbemont <pdherbemont@free.fr>
Thu, 17 Dec 2009 19:47:26 +0000 (20:47 +0100)
fdatasync is not exported. Fallback on fsync.

src/config/file.c

index 60c2cf05a880adee008b6dc92f0f0e36896d2bdd..db1128dc266597eada44da777a956e3e3393ef18 100644 (file)
@@ -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);