notmuch-dump: use fsync instead of fdatasync
authorDavid Bremner <david@tethera.net>
Thu, 8 May 2014 11:57:07 +0000 (20:57 +0900)
committerDavid Bremner <david@tethera.net>
Sat, 17 May 2014 21:31:15 +0000 (06:31 +0900)
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

index 2849eabaadb9b292b0eab8e4dab6c10d4b26398d..887a20822d828ef6dab98f58f156e37bebefdf06 100644 (file)
@@ -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));