$OpenBSD$

Our gzerror(3) expects it's errnum argument to be non-NULL.

zlib's gzclose_r() was introduced in 1.2.3.5 from 08.01.2010, we ship
1.2.3 from 18.07.2005.

Index: notmuch-restore.c
--- notmuch-restore.c.orig
+++ notmuch-restore.c
@@ -239,6 +239,8 @@ notmuch_restore_command (notmuch_config_t *config, int
     int include = 0;
     int input_format = DUMP_FORMAT_AUTO;
 
+    int errnum;
+
     if (notmuch_database_open (notmuch_config_get_database_path (config),
 			       NOTMUCH_DATABASE_MODE_READ_WRITE, &notmuch))
 	return EXIT_FAILURE;
@@ -449,9 +451,9 @@ notmuch_restore_command (notmuch_config_t *config, int
     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));
+		 name_for_error, gzerror (input, &errnum));
 	ret = EXIT_FAILURE;
     }
 
