actually use HAVE_FDATASYNC

This commit is contained in:
Michael Gehring
2016-01-26 14:21:40 +01:00
parent 0f56b68eac
commit 618e504d30
3 changed files with 12 additions and 0 deletions

View File

@@ -86,7 +86,11 @@ repodata_flush(struct xbps_handle *xhp, const char *repodir,
/* Write data to tempfile and rename */
archive_write_finish(ar);
#ifdef HAVE_FDATASYNC
fdatasync(repofd);
#else
fsync(repofd);
#endif
assert(fchmod(repofd, 0664) != -1);
close(repofd);
rename(tname, repofile);