@@ -118,7 +118,9 @@ static int _discoverArchiveFormat(ArchiveHandle *AH);
118
118
119
119
static int RestoringToDB (ArchiveHandle * AH );
120
120
static 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 )));
122
124
123
125
static void dumpTimestamp (ArchiveHandle * AH , const char * msg , time_t tim );
124
126
static void SetOutput (ArchiveHandle * AH , char * filename , int compression );
@@ -1299,7 +1301,7 @@ ahlog(ArchiveHandle *AH, int level, const char *fmt,...)
1299
1301
return ;
1300
1302
1301
1303
va_start (ap , fmt );
1302
- write_msg (NULL , fmt , ap );
1304
+ vwrite_msg (NULL , fmt , ap );
1303
1305
va_end (ap );
1304
1306
}
1305
1307
@@ -1418,10 +1420,12 @@ ahwrite(const void *ptr, size_t size, size_t nmemb, ArchiveHandle *AH)
1418
1420
}
1419
1421
1420
1422
1423
+ /* Report a fatal error and exit(1) */
1421
1424
static 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 )
1423
1427
{
1424
- write_msg (modulename , fmt , ap );
1428
+ vwrite_msg (modulename , fmt , ap );
1425
1429
1426
1430
if (AH )
1427
1431
{
@@ -1434,14 +1438,14 @@ _die_horribly(ArchiveHandle *AH, const char *modulename, const char *fmt, va_lis
1434
1438
exit (1 );
1435
1439
}
1436
1440
1437
- /* Archiver use (just different arg declaration) */
1441
+ /* As above, but with variable arg list */
1438
1442
void
1439
1443
die_horribly (ArchiveHandle * AH , const char * modulename , const char * fmt ,...)
1440
1444
{
1441
1445
va_list ap ;
1442
1446
1443
1447
va_start (ap , fmt );
1444
- _die_horribly (AH , modulename , fmt , ap );
1448
+ vdie_horribly (AH , modulename , fmt , ap );
1445
1449
va_end (ap );
1446
1450
}
1447
1451
@@ -1486,10 +1490,10 @@ warn_or_die_horribly(ArchiveHandle *AH,
1486
1490
1487
1491
va_start (ap , fmt );
1488
1492
if (AH -> public .exit_on_error )
1489
- _die_horribly (AH , modulename , fmt , ap );
1493
+ vdie_horribly (AH , modulename , fmt , ap );
1490
1494
else
1491
1495
{
1492
- write_msg (modulename , fmt , ap );
1496
+ vwrite_msg (modulename , fmt , ap );
1493
1497
AH -> public .n_errors ++ ;
1494
1498
}
1495
1499
va_end (ap );
@@ -2218,7 +2222,7 @@ ReadToc(ArchiveHandle *AH)
2218
2222
if (depIdx >= depSize )
2219
2223
{
2220
2224
depSize *= 2 ;
2221
- deps = (DumpId * ) realloc (deps , sizeof (DumpId ) * depSize );
2225
+ deps = (DumpId * ) pg_realloc (deps , sizeof (DumpId ) * depSize );
2222
2226
}
2223
2227
sscanf (tmp , "%d" , & deps [depIdx ]);
2224
2228
free (tmp );
@@ -2227,7 +2231,7 @@ ReadToc(ArchiveHandle *AH)
2227
2231
2228
2232
if (depIdx > 0 ) /* We have a non-null entry */
2229
2233
{
2230
- deps = (DumpId * ) realloc (deps , sizeof (DumpId ) * depIdx );
2234
+ deps = (DumpId * ) pg_realloc (deps , sizeof (DumpId ) * depIdx );
2231
2235
te -> dependencies = deps ;
2232
2236
te -> nDeps = depIdx ;
2233
2237
}
@@ -4062,7 +4066,7 @@ identify_locking_dependencies(TocEntry *te)
4062
4066
return ;
4063
4067
}
4064
4068
4065
- te -> lockDeps = realloc (lockids , nlockids * sizeof (DumpId ));
4069
+ te -> lockDeps = pg_realloc (lockids , nlockids * sizeof (DumpId ));
4066
4070
te -> nLockDeps = nlockids ;
4067
4071
}
4068
4072
0 commit comments