X-Git-Url: https://git.notmuchmail.org/git?a=blobdiff_plain;f=notmuch-dump.c;h=70cdb0c21718f8f0738760a0ed8d3e5a0486f44f;hb=a11b2f0f2d984b7f5974aff01c9fa80718449766;hp=ef2f02dfeb5cb5cc470da3462f75d6122f488f95;hpb=c3a683299d4c27d6eadaacf4fb516f73a6c69fc3;p=notmuch diff --git a/notmuch-dump.c b/notmuch-dump.c index ef2f02df..70cdb0c2 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);