From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from localhost (localhost [127.0.0.1]) by arlo.cworth.org (Postfix) with ESMTP id 0C50D6DE0E43 for ; Sun, 20 Nov 2016 03:22:14 -0800 (PST) X-Virus-Scanned: Debian amavisd-new at cworth.org X-Spam-Flag: NO X-Spam-Score: -0.011 X-Spam-Level: X-Spam-Status: No, score=-0.011 tagged_above=-999 required=5 tests=[RCVD_IN_DNSWL_NONE=-0.0001, SPF_PASS=-0.001, T_RP_MATCHES_RCVD=-0.01] autolearn=disabled Received: from arlo.cworth.org ([127.0.0.1]) by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id lyTjOV5_CwNE for ; Sun, 20 Nov 2016 03:22:13 -0800 (PST) X-Greylist: delayed 400 seconds by postgrey-1.35 at arlo; Sun, 20 Nov 2016 03:22:12 PST Received: from fe2.pruts.nl (pruts.nl [82.94.235.106]) by arlo.cworth.org (Postfix) with ESMTP id ECBA16DE0C81 for ; Sun, 20 Nov 2016 03:22:12 -0800 (PST) Received: from localhost (localhost.localdomain [127.0.0.1]) by fe2.pruts.nl (Postfix) with ESMTP id B5E5C1400A9 for ; Sun, 20 Nov 2016 12:15:28 +0100 (CET) X-Virus-Scanned: amavisd-new at pruts.nl Received: from fe2.pruts.nl ([IPv6:::ffff:127.0.0.1]) by localhost (fe2.local [::ffff:127.0.0.1]) (amavisd-new, port 10024) with ESMTP id Sg0P9phvXAvH; Sun, 20 Nov 2016 12:15:26 +0100 (CET) Received: from fe2.xs4all.nl (ipv6.pruts.nl [IPv6:2001:888:2000:18::3]) by fe2.pruts.nl (Postfix) with ESMTPSA id 78DD7140065; Sun, 20 Nov 2016 12:15:26 +0100 (CET) From: Ico Doornekamp To: notmuch@notmuchmail.org Cc: Ico Doornekamp Subject: [PATCH] gzclose_r() and gzclose_w() are not available in older versions of zlib such as the version on Ubuntu LTS 12.04. Changing to gzclose() allows notmuch to work on older versions as well Date: Sun, 20 Nov 2016 12:15:16 +0100 Message-Id: <1479640516-33847-1-git-send-email-ico@pruts.nl> X-Mailer: git-send-email 1.7.9.5 X-Mailman-Approved-At: Mon, 21 Nov 2016 08:13:06 -0800 X-BeenThere: notmuch@notmuchmail.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: "Use and development of the notmuch mail system." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sun, 20 Nov 2016 11:22:14 -0000 --- configure | 4 ++-- notmuch-dump.c | 4 ++-- notmuch-restore.c | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) diff --git a/configure b/configure index f0fc466..dc3256b 100755 --- a/configure +++ b/configure @@ -491,9 +491,9 @@ if ! pkg-config --exists zlib; then rm -f compat/gen_zlib_pc fi -printf "Checking for zlib (>= 1.2.5.2)... " +printf "Checking for zlib (>= 1.2.3.4)... " have_zlib=0 -if pkg-config --atleast-version=1.2.5.2 zlib; then +if pkg-config --atleast-version=1.2.3.4 zlib; then printf "Yes.\n" have_zlib=1 zlib_cflags=$(pkg-config --cflags zlib) diff --git a/notmuch-dump.c b/notmuch-dump.c index e7965ce..637d93f 100644 --- a/notmuch-dump.c +++ b/notmuch-dump.c @@ -328,7 +328,7 @@ notmuch_database_dump (notmuch_database_t *notmuch, } } - if (gzclose_w (output) != Z_OK) { + if (gzclose (output) != Z_OK) { fprintf (stderr, "Error closing %s: %s\n", name_for_error, gzerror (output, NULL)); ret = EXIT_FAILURE; @@ -347,7 +347,7 @@ notmuch_database_dump (notmuch_database_t *notmuch, } DONE: if (ret != EXIT_SUCCESS && output) - (void) gzclose_w (output); + (void) gzclose (output); if (ret != EXIT_SUCCESS && output_file_name) (void) unlink (tempname); diff --git a/notmuch-restore.c b/notmuch-restore.c index d6429ef..b37cfe2 100644 --- a/notmuch-restore.c +++ b/notmuch-restore.c @@ -449,7 +449,7 @@ notmuch_restore_command (notmuch_config_t *config, int argc, char *argv[]) if (notmuch) notmuch_database_destroy (notmuch); - if (input && gzclose_r (input)) { + if (input && gzclose (input)) { fprintf (stderr, "Error closing %s: %s\n", name_for_error, gzerror (input, NULL)); ret = EXIT_FAILURE; -- 1.7.9.5