54
54
55
55
#include "compress_io.h"
56
56
#include "dumpmem.h"
57
+ #include "dumputils.h"
57
58
58
59
/*----------------------
59
60
* Compressor API
@@ -109,8 +110,8 @@ ParseCompressionOption(int compression, CompressionAlgorithm *alg, int *level)
109
110
* alg = COMPR_ALG_NONE ;
110
111
else
111
112
{
112
- die_horribly ( NULL , modulename , "Invalid compression code: %d\n" ,
113
- compression );
113
+ exit_horribly ( modulename , "Invalid compression code: %d\n" ,
114
+ compression );
114
115
* alg = COMPR_ALG_NONE ; /* keep compiler quiet */
115
116
}
116
117
@@ -133,7 +134,7 @@ AllocateCompressor(int compression, WriteFunc writeF)
133
134
134
135
#ifndef HAVE_LIBZ
135
136
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" );
137
138
#endif
138
139
139
140
cs = (CompressorState * ) pg_calloc (1 , sizeof (CompressorState ));
@@ -169,7 +170,7 @@ ReadDataFromArchive(ArchiveHandle *AH, int compression, ReadFunc readF)
169
170
#ifdef HAVE_LIBZ
170
171
ReadDataFromArchiveZlib (AH , readF );
171
172
#else
172
- die_horribly ( NULL , modulename , "not built with zlib support\n" );
173
+ exit_horribly ( modulename , "not built with zlib support\n" );
173
174
#endif
174
175
}
175
176
}
@@ -187,7 +188,7 @@ WriteDataToArchive(ArchiveHandle *AH, CompressorState *cs,
187
188
#ifdef HAVE_LIBZ
188
189
return WriteDataToArchiveZlib (AH , cs , data , dLen );
189
190
#else
190
- die_horribly ( NULL , modulename , "not built with zlib support\n" );
191
+ exit_horribly ( modulename , "not built with zlib support\n" );
191
192
#endif
192
193
case COMPR_ALG_NONE :
193
194
return WriteDataToArchiveNone (AH , cs , data , dLen );
@@ -234,9 +235,9 @@ InitCompressorZlib(CompressorState *cs, int level)
234
235
cs -> zlibOutSize = ZLIB_OUT_SIZE ;
235
236
236
237
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 );
240
241
241
242
/* Just be paranoid - maybe End is called after Start, with no Write */
242
243
zp -> next_out = (void * ) cs -> zlibOut ;
@@ -343,9 +344,9 @@ ReadDataFromArchiveZlib(ArchiveHandle *AH, ReadFunc readF)
343
344
out = pg_malloc (ZLIB_OUT_SIZE + 1 );
344
345
345
346
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 );
349
350
350
351
/* no minimal chunk size for zlib */
351
352
while ((cnt = readF (AH , & buf , & buflen )))
@@ -514,7 +515,7 @@ cfopen_write(const char *path, const char *mode, int compression)
514
515
fp = cfopen (fname , mode , 1 );
515
516
free (fname );
516
517
#else
517
- die_horribly ( NULL , modulename , "not built with zlib support\n" );
518
+ exit_horribly ( modulename , "not built with zlib support\n" );
518
519
fp = NULL ; /* keep compiler quiet */
519
520
#endif
520
521
}
@@ -541,7 +542,7 @@ cfopen(const char *path, const char *mode, int compression)
541
542
fp = NULL ;
542
543
}
543
544
#else
544
- die_horribly ( NULL , modulename , "not built with zlib support\n" );
545
+ exit_horribly ( modulename , "not built with zlib support\n" );
545
546
#endif
546
547
}
547
548
else
0 commit comments