1
0
mirror of https://github.com/postgrespro/pg_probackup.git synced 2025-09-16 09:26:30 +02:00

Replaced the function strftime with pg_strftime for logs in Windows

This commit is contained in:
Victor Spirin
2019-04-09 18:05:36 +03:00
parent df0cd6507b
commit 1ff905989e
2 changed files with 5 additions and 0 deletions

View File

@@ -182,6 +182,7 @@ sub build_pgprobackup
$probackup->AddFile("$pgsrc/src/bin/pg_rewind/datapagemap.c");
$probackup->AddFile("$pgsrc/src/interfaces/libpq/pthread-win32.c");
$probackup->AddFile("$pgsrc/src/timezone/strftime.c");
$probackup->AddIncludeDir("$pgsrc/src/bin/pg_basebackup");
$probackup->AddIncludeDir("$pgsrc/src/bin/pg_rewind");

View File

@@ -470,7 +470,11 @@ logfile_getname(const char *format, time_t timestamp)
len = strlen(filename);
/* Treat log_filename as a strftime pattern */
#ifdef WIN32
if (pg_strftime(filename + len, MAXPGPATH - len, format, tm) <= 0)
#else
if (strftime(filename + len, MAXPGPATH - len, format, tm) <= 0)
#endif
elog_stderr(ERROR, "strftime(%s) failed: %s", format, strerror(errno));
return filename;