@@ -118,7 +118,9 @@ static int _discoverArchiveFormat(ArchiveHandle *AH);
118118
119119static int RestoringToDB (ArchiveHandle * AH );
120120static void dump_lo_buf (ArchiveHandle * AH );
121- static void _die_horribly (ArchiveHandle * AH , const char * modulename , const char * fmt , va_list ap ) __attribute__((format (PG_PRINTF_ATTRIBUTE , 3 , 0 )));
121+ static void vdie_horribly (ArchiveHandle * AH , const char * modulename ,
122+ const char * fmt , va_list ap )
123+ __attribute__((format (PG_PRINTF_ATTRIBUTE , 3 , 0 )));
122124
123125static void dumpTimestamp (ArchiveHandle * AH , const char * msg , time_t tim );
124126static void SetOutput (ArchiveHandle * AH , char * filename , int compression );
@@ -1299,7 +1301,7 @@ ahlog(ArchiveHandle *AH, int level, const char *fmt,...)
12991301 return ;
13001302
13011303 va_start (ap , fmt );
1302- write_msg (NULL , fmt , ap );
1304+ vwrite_msg (NULL , fmt , ap );
13031305 va_end (ap );
13041306}
13051307
@@ -1418,10 +1420,12 @@ ahwrite(const void *ptr, size_t size, size_t nmemb, ArchiveHandle *AH)
14181420}
14191421
14201422
1423+ /* Report a fatal error and exit(1) */
14211424static void
1422- _die_horribly (ArchiveHandle * AH , const char * modulename , const char * fmt , va_list ap )
1425+ vdie_horribly (ArchiveHandle * AH , const char * modulename ,
1426+ const char * fmt , va_list ap )
14231427{
1424- write_msg (modulename , fmt , ap );
1428+ vwrite_msg (modulename , fmt , ap );
14251429
14261430 if (AH )
14271431 {
@@ -1434,14 +1438,14 @@ _die_horribly(ArchiveHandle *AH, const char *modulename, const char *fmt, va_lis
14341438 exit (1 );
14351439}
14361440
1437- /* Archiver use (just different arg declaration) */
1441+ /* As above, but with variable arg list */
14381442void
14391443die_horribly (ArchiveHandle * AH , const char * modulename , const char * fmt ,...)
14401444{
14411445 va_list ap ;
14421446
14431447 va_start (ap , fmt );
1444- _die_horribly (AH , modulename , fmt , ap );
1448+ vdie_horribly (AH , modulename , fmt , ap );
14451449 va_end (ap );
14461450}
14471451
@@ -1486,10 +1490,10 @@ warn_or_die_horribly(ArchiveHandle *AH,
14861490
14871491 va_start (ap , fmt );
14881492 if (AH -> public .exit_on_error )
1489- _die_horribly (AH , modulename , fmt , ap );
1493+ vdie_horribly (AH , modulename , fmt , ap );
14901494 else
14911495 {
1492- write_msg (modulename , fmt , ap );
1496+ vwrite_msg (modulename , fmt , ap );
14931497 AH -> public .n_errors ++ ;
14941498 }
14951499 va_end (ap );
@@ -2218,7 +2222,7 @@ ReadToc(ArchiveHandle *AH)
22182222 if (depIdx >= depSize )
22192223 {
22202224 depSize *= 2 ;
2221- deps = (DumpId * ) realloc (deps , sizeof (DumpId ) * depSize );
<
E86E
code> 2225+ deps = (DumpId * ) pg_realloc (deps , sizeof (DumpId ) * depSize );
22222226 }
22232227 sscanf (tmp , "%d" , & deps [depIdx ]);
22242228 free (tmp );
@@ -2227,7 +2231,7 @@ ReadToc(ArchiveHandle *AH)
22272231
22282232 if (depIdx > 0 ) /* We have a non-null entry */
22292233 {
2230- deps = (DumpId * ) realloc (deps , sizeof (DumpId ) * depIdx );
2234+ deps = (DumpId * ) pg_realloc (deps , sizeof (DumpId ) * depIdx );
22312235 te -> dependencies = deps ;
22322236 te -> nDeps = depIdx ;
22332237 }
@@ -4062,7 +4066,7 @@ identify_locking_dependencies(TocEntry *te)
40624066 return ;
40634067 }
40644068
4065- te -> lockDeps = realloc (lockids , nlockids * sizeof (DumpId ));
4069+ te -> lockDeps = pg_realloc (lockids , nlockids * sizeof (DumpId ));
40664070 te -> nLockDeps = nlockids ;
40674071}
40684072
0 commit comments