mirror of
https://github.com/postgres/postgres.git
synced 2025-07-30 11:03:19 +03:00
Adjust pg_upgrade to output a separate log file for pg_ctl output on
Windows, to avoid opening a file by multiple processes.
This commit is contained in:
@ -55,11 +55,16 @@ ClusterInfo old_cluster,
|
||||
new_cluster;
|
||||
OSInfo os_info;
|
||||
|
||||
char *output_files[NUM_LOG_FILES] = {
|
||||
char *output_files[] = {
|
||||
SERVER_LOG_FILE,
|
||||
#ifdef WIN32
|
||||
/* file is unique on Win32 */
|
||||
SERVER_LOG_FILE2,
|
||||
#endif
|
||||
RESTORE_LOG_FILE,
|
||||
UTILITY_LOG_FILE,
|
||||
INTERNAL_LOG_FILE
|
||||
INTERNAL_LOG_FILE,
|
||||
NULL
|
||||
};
|
||||
|
||||
|
||||
@ -454,21 +459,14 @@ cleanup(void)
|
||||
/* Remove dump and log files? */
|
||||
if (!log_opts.retain)
|
||||
{
|
||||
char filename[MAXPGPATH];
|
||||
int i;
|
||||
char **filename;
|
||||
|
||||
for (i = 0; i < NUM_LOG_FILES; i++)
|
||||
{
|
||||
snprintf(filename, sizeof(filename), "%s", output_files[i]);
|
||||
unlink(filename);
|
||||
}
|
||||
for (filename = output_files; *filename != NULL; filename++)
|
||||
unlink(*filename);
|
||||
|
||||
/* remove SQL files */
|
||||
snprintf(filename, sizeof(filename), "%s", ALL_DUMP_FILE);
|
||||
unlink(filename);
|
||||
snprintf(filename, sizeof(filename), "%s", GLOBALS_DUMP_FILE);
|
||||
unlink(filename);
|
||||
snprintf(filename, sizeof(filename), "%s", DB_DUMP_FILE);
|
||||
unlink(filename);
|
||||
unlink(ALL_DUMP_FILE);
|
||||
unlink(GLOBALS_DUMP_FILE);
|
||||
unlink(DB_DUMP_FILE);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user