Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3f1fd41

Browse files
committed
Fix another incorrect data type choice from commit dc21234.
add_file_to_manifest declared its mtime argument as pg_time_t, apparently on the principle that copy-and-paste from the backend is fine. However, the callers are passing struct stat's st_mtime field which is plain time_t, and add_file_to_manifest itself is passing the value to gmtime(3) which expects plain time_t, so the whole thing would not work at all on any platform where those types are different. Fortunately we can just switch this variable to time_t. Per warnings from assorted buildfarm members.
1 parent 390408e commit 3f1fd41

File tree

2 files changed

+2
-3
lines changed

2 files changed

+2
-3
lines changed

src/bin/pg_combinebackup/write_manifest.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -72,7 +72,7 @@ create_manifest_writer(char *directory)
7272
*/
7373
void
7474
add_file_to_manifest(manifest_writer *mwriter, const char *manifest_path,
75-
size_t size, pg_time_t mtime,
75+
size_t size, time_t mtime,
7676
pg_checksum_type checksum_type,
7777
int checksum_length,
7878
uint8 *checksum_payload)

src/bin/pg_combinebackup/write_manifest.h

+1-2
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
#define WRITE_MANIFEST_H
1414

1515
#include "common/checksum_helper.h"
16-
#include "pgtime.h"
1716

1817
struct manifest_wal_range;
1918

@@ -23,7 +22,7 @@ typedef struct manifest_writer manifest_writer;
2322
extern manifest_writer *create_manifest_writer(char *directory);
2423
extern void add_file_to_manifest(manifest_writer *mwriter,
2524
const char *manifest_path,
26-
size_t size, pg_time_t mtime,
25+
size_t size, time_t mtime,
2726
pg_checksum_type checksum_type,
2827
int checksum_length,
2928
uint8 *checksum_payload);

0 commit comments

Comments
 (0)