[PATCH] notmuch-dump: use fsync instead of fdatasync

David Bremner david at tethera.net
Thu May 8 04:57:07 PDT 2014


Since the file size will have changed, there is no performance benefit
to calling fdatasync.  Somewhat surprisingly, using fdatasync
apparently causes portability problems on FreeBSD.
---
 notmuch-dump.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/notmuch-dump.c b/notmuch-dump.c
index 2849eab..887a208 100644
--- a/notmuch-dump.c
+++ b/notmuch-dump.c
@@ -169,7 +169,7 @@ notmuch_database_dump (notmuch_database_t *notmuch,
     }
 
     if (output_file_name) {
-	ret = fdatasync (outfd);
+	ret = fsync (outfd);
 	if (ret) {
 	    fprintf (stderr, "Error syncing %s to disk: %s\n",
 		     name_for_error, strerror (errno));
-- 
1.9.2



More information about the notmuch mailing list