Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitd923125

Browse files
committed
Fix incorrect uses of gzFile
gzFile is already a pointer, so code likegzFile *handle = gzopen(...)is wrong.This used to pass silently because gzFile used to be defined as void*,and you can assign a void* to a void**. But somewhere between zlibversions 1.2.3.4 and 1.2.6, the definition of gzFile was changed tostruct gzFile_s *, and with that new definition this usage causescompiler warnings.So remove all those extra pointer decorations.There is a related issue in pg_backup_archiver.h, whereFILE *FH; /* General purpose file handle */is used throughout pg_dump as sometimes a real FILE* and sometimes agzFile handle, which also causes warnings now. This is not yet fixedhere, because it might need more code restructuring.
1 parent8e5f430 commitd923125

File tree

3 files changed

+7
-10
lines changed

3 files changed

+7
-10
lines changed

‎src/bin/pg_basebackup/pg_basebackup.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ static bool segment_callback(XLogRecPtr segendpos, uint32 timeline);
8282

8383
#ifdefHAVE_LIBZ
8484
staticconstchar*
85-
get_gz_error(gzFile*gzf)
85+
get_gz_error(gzFilegzf)
8686
{
8787
interrnum;
8888
constchar*errmsg;
@@ -450,7 +450,7 @@ ReceiveTarFile(PGconn *conn, PGresult *res, int rownum)
450450
FILE*tarfile=NULL;
451451

452452
#ifdefHAVE_LIBZ
453-
gzFile*ztarfile=NULL;
453+
gzFileztarfile=NULL;
454454
#endif
455455

456456
if (PQgetisnull(res,rownum,0))

‎src/bin/pg_dump/pg_backup_files.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ typedef struct
6060
typedefstruct
6161
{
6262
#ifdefHAVE_LIBZ
63-
gzFile*FH;
63+
gzFileFH;
6464
#else
6565
FILE*FH;
6666
#endif

‎src/bin/pg_dump/pg_backup_tar.c

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,16 +58,13 @@ static void _EndBlobs(ArchiveHandle *AH, TocEntry *te);
5858
#defineK_STD_BUF_SIZE 1024
5959

6060

61+
typedefstruct
62+
{
6163
#ifdefHAVE_LIBZ
62-
/* typedef gzFile ThingFile; */
63-
typedefFILEThingFile;
64+
gzFilezFH;
6465
#else
65-
typedefFILEThingFile;
66+
FILE*zFH;
6667
#endif
67-
68-
typedefstruct
69-
{
70-
ThingFile*zFH;
7168
FILE*nFH;
7269
FILE*tarFH;
7370
FILE*tmpFH;

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp