X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=notmuch-dump.c;h=fab22bdd6bcfe7f1b0ca26e433001d49e416c4ab;hp=2849eabaadb9b292b0eab8e4dab6c10d4b26398d;hb=5a3b42fb8c556397841b86c5fda1c4554dab253a;hpb=3c13bc0321baaf340663779d6fce2b1f34c1c2c3 diff --git a/notmuch-dump.c b/notmuch-dump.c index 2849eaba..fab22bdd 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)); @@ -212,7 +212,7 @@ notmuch_dump_command (notmuch_config_t *config, int argc, char *argv[]) int ret; if (notmuch_database_open (notmuch_config_get_database_path (config), - NOTMUCH_DATABASE_MODE_READ_ONLY, ¬much)) + NOTMUCH_DATABASE_MODE_READ_WRITE, ¬much)) return EXIT_FAILURE; char *output_file_name = NULL; @@ -228,6 +228,7 @@ notmuch_dump_command (notmuch_config_t *config, int argc, char *argv[]) { 0, 0 } } }, { NOTMUCH_OPT_STRING, &output_file_name, "output", 'o', 0 }, { NOTMUCH_OPT_BOOLEAN, &gzip_output, "gzip", 'z', 0 }, + { NOTMUCH_OPT_INHERIT, (void *) ¬much_shared_options, NULL, 0, 0 }, { 0, 0, 0, 0, 0 } }; @@ -235,6 +236,8 @@ notmuch_dump_command (notmuch_config_t *config, int argc, char *argv[]) if (opt_index < 0) return EXIT_FAILURE; + notmuch_process_shared_options (argv[0]); + if (opt_index < argc) { query_str = query_string_from_args (notmuch, argc - opt_index, argv + opt_index); if (query_str == NULL) {