X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=notmuch-dump.c;h=65e026394cf77e12d9fe3ba2772c395eb789b750;hb=c578c32e3be76fe19c3e7355a88fcb799b68b17e;hp=505c1469657cfac48945bd394a1aef06d7f74ee2;hpb=33382c2b5ba2537952a60ea378feff36961e4713;p=notmuch diff --git a/notmuch-dump.c b/notmuch-dump.c index 505c1469..65e02639 100644 --- a/notmuch-dump.c +++ b/notmuch-dump.c @@ -329,13 +329,15 @@ notmuch_database_dump (notmuch_database_t *notmuch, } } - if (gzclose_w (output) != Z_OK) { + ret = gzclose_w (output); + if (ret) { fprintf (stderr, "Error closing %s: %s\n", name_for_error, gzerror (output, NULL)); ret = EXIT_FAILURE; output = NULL; goto DONE; - } + } else + output = NULL; if (output_file_name) { ret = rename (tempname, output_file_name);