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

Commitdb1531c

Browse files
committed
Be more careful about time_t vs. pg_time_t in basebackup.c.
lapwing is complaining that about a call to pg_gmtime, saying thatit "expected 'const pg_time_t *' but argument is of type 'time_t *'".I at first thought that the problem had someting to do with const,but Thomas Munro suggested that it might be just because time_tand pg_time_t are different identifers. lapwing is i686 rather thanx86_64, and pg_time_t is always int64, so that seems like a goodguess.There is other code that just casts time_t to pg_time_t withoutany conversion function, so try that approach here.Introduced in commit0d8c9c1.
1 parent9f8f881 commitdb1531c

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

‎src/backend/replication/basebackup.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,8 @@ static void InitializeManifest(manifest_info *manifest,
9999
basebackup_options*opt);
100100
staticvoidAppendStringToManifest(manifest_info*manifest,char*s);
101101
staticvoidAddFileToManifest(manifest_info*manifest,constchar*spcoid,
102-
constchar*pathname,size_tsize,time_tmtime,
102+
constchar*pathname,size_tsize,
103+
pg_time_tmtime,
103104
pg_checksum_context*checksum_ctx);
104105
staticvoidAddWALInfoToManifest(manifest_info*manifest,XLogRecPtrstartptr,
105106
TimeLineIDstarttli,XLogRecPtrendptr,
@@ -1124,7 +1125,7 @@ AppendStringToManifest(manifest_info *manifest, char *s)
11241125
*/
11251126
staticvoid
11261127
AddFileToManifest(manifest_info*manifest,constchar*spcoid,
1127-
constchar*pathname,size_tsize,time_tmtime,
1128+
constchar*pathname,size_tsize,pg_time_tmtime,
11281129
pg_checksum_context*checksum_ctx)
11291130
{
11301131
charpathbuf[MAXPGPATH];
@@ -1507,7 +1508,8 @@ sendFileWithContent(const char *filename, const char *content,
15071508
}
15081509

15091510
pg_checksum_update(&checksum_ctx, (uint8*)content,len);
1510-
AddFileToManifest(manifest,NULL,filename,len,statbuf.st_mtime,
1511+
AddFileToManifest(manifest,NULL,filename,len,
1512+
(pg_time_t)statbuf.st_mtime,
15111513
&checksum_ctx);
15121514
}
15131515

@@ -2188,7 +2190,7 @@ sendFile(const char *readfilename, const char *tarfilename,
21882190
total_checksum_failures+=checksum_failures;
21892191

21902192
AddFileToManifest(manifest,spcoid,tarfilename,statbuf->st_size,
2191-
statbuf->st_mtime,&checksum_ctx);
2193+
(pg_time_t)statbuf->st_mtime,&checksum_ctx);
21922194

21932195
return true;
21942196
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp