openbsd-ports

OpenBSD Ports customizations and WIP
git clone git://git.danielmoch.com/openbsd-ports.git
Log | Files | Refs

patch-notmuch-dump_c (956B)


      1 $OpenBSD$
      2 
      3 OpenBSD zlib is too old for gzclose_w
      4 
      5 XXX various problems in gzip-related regression tests. many of them die with
      6 segfaults; suspect the naive s/gzclose_w/gzclose/ may result in use-after-free
      7 with the second gzclose call. some hang and are disabled in the port Makefile
      8 by TEST_FLAGS=NOTMUCH_SKIP_TESTS="[..]" - should be reenabled if testing any
      9 fixes to this.
     10 
     11 Index: notmuch-dump.c
     12 --- notmuch-dump.c.orig
     13 +++ notmuch-dump.c
     14 @@ -329,7 +329,7 @@ notmuch_database_dump (notmuch_database_t *notmuch,
     15  	}
     16      }
     17  
     18 -    ret = gzclose_w (output);
     19 +    ret = gzclose (output);
     20      if (ret) {
     21  	fprintf (stderr, "Error closing %s: %s\n", name_for_error,
     22  		 gzerror (output, NULL));
     23 @@ -350,7 +350,7 @@ notmuch_database_dump (notmuch_database_t *notmuch,
     24      }
     25   DONE:
     26      if (ret != EXIT_SUCCESS && output)
     27 -	(void) gzclose_w (output);
     28 +	(void) gzclose (output);
     29  
     30      if (ret != EXIT_SUCCESS && output_file_name)
     31  	(void) unlink (tempname);