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

Tomi Ollila tomi.ollila at iki.fi
Thu May 8 08:36:28 PDT 2014


On Thu, May 08 2014, David Bremner <david at tethera.net> wrote:

> 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.
> ---

Well, this is easy to review! LGTM.

Tomi


>  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