[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

Ico Doornekamp ico at pruts.nl
Sun Nov 20 03:15:16 PST 2016


---
 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



More information about the notmuch mailing list