From: Pierre d'Herbemont Date: Thu, 17 Dec 2009 19:44:24 +0000 (+0100) Subject: config: Use fsync on Snow Leopard. X-Git-Tag: 1.1.0-ff~1921 X-Git-Url: https://git.sesse.net/?a=commitdiff_plain;h=f91c76f9c59dfa50514e63f8ad1c8857f65cadee;p=vlc config: Use fsync on Snow Leopard. fdatasync is not exported. Fallback on fsync. --- diff --git a/src/config/file.c b/src/config/file.c index 60c2cf05a8..db1128dc26 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);