X-Git-Url: https://git.notmuchmail.org/git?p=notmuch;a=blobdiff_plain;f=status.c;h=09d82a172ba8315aa5184db0aa6bedfa6651b180;hp=d0ae47f4d03cb6eb5522df2913f170d77d15e71f;hb=HEAD;hpb=7ad7cfbff232431377562271901ee00202bf0bd0 diff --git a/status.c b/status.c index d0ae47f4..09d82a17 100644 --- a/status.c +++ b/status.c @@ -72,3 +72,17 @@ status_to_exit (notmuch_status_t status) return EXIT_FAILURE; } } + +notmuch_status_t +print_status_gzbytes (const char *loc, gzFile file, int bytes) +{ + if (bytes <= 0) { + int errnum; + const char *errstr = gzerror (file, &errnum); + fprintf (stderr, "%s: zlib error %s (%d)\n", loc, errstr, errnum); + return NOTMUCH_STATUS_FILE_ERROR; + } else { + return NOTMUCH_STATUS_SUCCESS; + } +} +