X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=notmuch-restore.c;h=544f422802d15502b1ab2e73e69e976833a5a549;hb=fd6f8e6c30e0443d1ead248047ab572120df85e9;hp=4b509d95ba003dd4342d2bd74ed47c67d4bca6d8;hpb=33382c2b5ba2537952a60ea378feff36961e4713;p=notmuch diff --git a/notmuch-restore.c b/notmuch-restore.c index 4b509d95..544f4228 100644 --- a/notmuch-restore.c +++ b/notmuch-restore.c @@ -219,7 +219,7 @@ parse_sup_line (void *ctx, char *line, } int -notmuch_restore_command (notmuch_config_t *config, int argc, char *argv[]) +notmuch_restore_command (notmuch_config_t *config, unused(notmuch_database_t *notmuch), int argc, char *argv[]) { notmuch_database_t *notmuch; bool accumulate = false; @@ -237,6 +237,7 @@ notmuch_restore_command (notmuch_config_t *config, int argc, char *argv[]) int opt_index; int include = 0; int input_format = DUMP_FORMAT_AUTO; + int errnum; if (notmuch_database_open (notmuch_config_get_database_path (config), NOTMUCH_DATABASE_MODE_READ_WRITE, ¬much)) @@ -448,10 +449,13 @@ notmuch_restore_command (notmuch_config_t *config, int argc, char *argv[]) if (notmuch) notmuch_database_destroy (notmuch); - if (input && gzclose_r (input)) { - fprintf (stderr, "Error closing %s: %s\n", - name_for_error, gzerror (input, NULL)); - ret = EXIT_FAILURE; + if (input) { + errnum = gzclose_r (input); + if (errnum) { + fprintf (stderr, "Error closing %s: %d\n", + name_for_error, errnum); + ret = EXIT_FAILURE; + } } return ret ? EXIT_FAILURE : EXIT_SUCCESS;