5454
5555#include "compress_io.h"
5656#include "dumpmem.h"
57+ #include "dumputils.h"
5758
5859/*----------------------
5960 * Compressor API
@@ -109,8 +110,8 @@ ParseCompressionOption(int compression, CompressionAlgorithm *alg, int *level)
109110 * alg = COMPR_ALG_NONE ;
110111 else
111112 {
112- die_horribly ( NULL , modulename , "Invalid compression code: %d\n" ,
113- compression );
113+ exit_horribly ( modulename , "Invalid compression code: %d\n" ,
114+ compression );
114115 * alg = COMPR_ALG_NONE ; /* keep compiler quiet */
115116 }
116117
@@ -133,7 +134,7 @@ AllocateCompressor(int compression, WriteFunc writeF)
133134
134135#ifndef HAVE_LIBZ
135136 if (alg == COMPR_ALG_LIBZ )
136- die_horribly ( NULL , modulename , "not built with zlib support\n" );
137+ exit_horribly ( modulename , "not built with zlib support\n" );
137138#endif
138139
139140 cs = (CompressorState * ) pg_calloc (1 , sizeof (CompressorState ));
@@ -169,7 +170,7 @@ ReadDataFromArchive(ArchiveHandle *AH, int compression, ReadFunc readF)
169170#ifdef HAVE_LIBZ
170171 ReadDataFromArchiveZlib (AH , readF );
171172#else
172- die_horribly ( NULL , modulename , "not built with zlib support\n" );
173+ exit_horribly ( modulename , "not built with zlib support\n" );
173174#endif
174175 }
175176}
@@ -187,7 +188,7 @@ WriteDataToArchive(ArchiveHandle *AH, CompressorState *cs,
187188#ifdef HAVE_LIBZ
188189 return WriteDataToArchiveZlib (AH , cs , data , dLen );
189190#else
190- die_horribly ( NULL , modulename , "not built with zlib support\n" );
191+ exit_horribly ( modulename , "not built with zlib support\n" );
191192#endif
192193 case COMPR_ALG_NONE :
193194 return WriteDataToArchiveNone (AH , cs , data , dLen );
@@ -234,9 +235,9 @@ InitCompressorZlib(CompressorState *cs, int level)
234235 cs -> zlibOutSize = ZLIB_OUT_SIZE ;
235236
236237 if (deflateInit (zp , level ) != Z_OK )
237- die_horribly ( NULL , modulename ,
238- "could not initialize compression library: %s\n" ,
239- zp -> msg );
238+ exit_horribly ( modulename ,
239+ "could not initialize compression library: %s\n" ,
240+ zp -> msg );
240241
241242 /* Just be paranoid - maybe End is called after Start, with no Write */
242243 zp -> next_out = (void * ) cs -> zlibOut ;
@@ -343,9 +344,9 @@ ReadDataFromArchiveZlib(ArchiveHandle *AH, ReadFunc readF)
343344 out = pg_malloc (ZLIB_OUT_SIZE + 1 );
344345
345346 if (inflateInit (zp ) != Z_OK )
346- die_horribly ( NULL , modulename ,
347- "could not initialize compression library: %s\n" ,
348- zp -> msg );
347+ exit_horribly ( modulename ,
348+ "could not initialize compression library: %s\n" ,
349+ zp -> msg );
349350
350351 /* no minimal chunk size for zlib */
351352 while ((cnt = readF (AH , & buf , & buflen )))
@@ -514,7 +515,7 @@ cfopen_write(const char *path, const char *mode, int compression)
514515 fp = cfopen (fname , mode , 1 );
515516 free (fname );
516517#else
517- die_horribly ( NULL , modulename , "not built with zlib support\n" );
518+ exit_horribly ( modulename , "not built with zlib support\n" );
518519 fp = NULL ; /* keep compiler quiet */
519520#endif
520521 }
@@ -541,7 +542,7 @@ cfopen(const char *path, const char *mode, int compression)
541542 fp = NULL ;
542543 }
543544#else
544- die_horribly ( NULL , modulename , "not built with zlib support\n" );
545+ exit_horribly ( modulename , "not built with zlib support\n" );
545546#endif
546547 }
547548 else
0 commit comments