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

s:snprintf(..., MAXPGPATH, "%s/%s", ...):join_path_components(...):g#393

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged
gsmolk merged 1 commit intomasterfromjoin_path_components
Jun 7, 2021
Merged
Show file tree
Hide file tree
Changes fromall commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletionssrc/catalog.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -829,7 +829,7 @@ IsDir(const char *dirpath, const char *entry, fio_location location)
charpath[MAXPGPATH];
struct statst;

snprintf(path, MAXPGPATH, "%s/%s", dirpath, entry);
join_path_components(path, dirpath, entry);

return fio_stat(path, &st, false, location) == 0 && S_ISDIR(st.st_mode);
}
Expand DownExpand Up@@ -941,7 +941,7 @@ catalog_get_backup_list(const char *instance_name, time_t requested_backup_id)
join_path_components(data_path, backup_instance_path, data_ent->d_name);

/* read backup information from BACKUP_CONTROL_FILE */
snprintf(backup_conf_path, MAXPGPATH, "%s/%s", data_path, BACKUP_CONTROL_FILE);
join_path_components(backup_conf_path, data_path, BACKUP_CONTROL_FILE);
backup = readBackupControlFile(backup_conf_path);

if (!backup)
Expand Down
2 changes: 1 addition & 1 deletionsrc/parsexlog.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1017,7 +1017,7 @@ SimpleXLogPageRead(XLogReaderState *xlogreader, XLogRecPtr targetPagePtr,

GetXLogFileName(xlogfname, reader_data->tli, reader_data->xlogsegno, wal_seg_size);

snprintf(reader_data->xlogpath, MAXPGPATH, "%s/%s", wal_archivedir, xlogfname);
join_path_components(reader_data->xlogpath, wal_archivedir, xlogfname);
snprintf(reader_data->gz_xlogpath, MAXPGPATH, "%s.gz", reader_data->xlogpath);

/* We fall back to using .partial segment in case if we are running
Expand Down
13 changes: 6 additions & 7 deletionssrc/restore.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1480,7 +1480,7 @@ update_recovery_options_before_v12(pgBackup *backup,
}

elog(LOG, "update recovery settings in recovery.conf");
snprintf(path,lengthof(path), "%s/recovery.conf", instance_config.pgdata);
join_path_components(path,instance_config.pgdata, "recovery.conf");

fp = fio_fopen(path, "w", FIO_DB_HOST);
if (fp == NULL)
Expand DownExpand Up@@ -1537,8 +1537,7 @@ update_recovery_options(pgBackup *backup,

time2iso(current_time_str, lengthof(current_time_str), current_time, false);

snprintf(postgres_auto_path, lengthof(postgres_auto_path),
"%s/postgresql.auto.conf", instance_config.pgdata);
join_path_components(postgres_auto_path, instance_config.pgdata, "postgresql.auto.conf");

if (fio_stat(postgres_auto_path, &st, false, FIO_DB_HOST) < 0)
{
Expand DownExpand Up@@ -1648,7 +1647,7 @@ update_recovery_options(pgBackup *backup,
if (params->recovery_settings_mode == PITR_REQUESTED)
{
elog(LOG, "creating recovery.signal file");
snprintf(path,lengthof(path), "%s/recovery.signal", instance_config.pgdata);
join_path_components(path,instance_config.pgdata, "recovery.signal");

fp = fio_fopen(path, PG_BINARY_W, FIO_DB_HOST);
if (fp == NULL)
Expand All@@ -1664,7 +1663,7 @@ update_recovery_options(pgBackup *backup,
if (params->restore_as_replica)
{
elog(LOG, "creating standby.signal file");
snprintf(path,lengthof(path), "%s/standby.signal", instance_config.pgdata);
join_path_components(path,instance_config.pgdata, "standby.signal");

fp = fio_fopen(path, PG_BINARY_W, FIO_DB_HOST);
if (fp == NULL)
Expand DownExpand Up@@ -2160,7 +2159,7 @@ check_incremental_compatibility(const char *pgdata, uint64 system_identifier,
{
char pid_file[MAXPGPATH];

snprintf(pid_file,MAXPGPATH, "%s/postmaster.pid", pgdata);
join_path_components(pid_file,pgdata, "postmaster.pid");
elog(WARNING, "Pid file \"%s\" is mangled, cannot determine whether postmaster is running or not",
pid_file);
success = false;
Expand DownExpand Up@@ -2201,7 +2200,7 @@ check_incremental_compatibility(const char *pgdata, uint64 system_identifier,
*/
if (incremental_mode == INCR_LSN)
{
snprintf(backup_label,MAXPGPATH, "%s/backup_label", pgdata);
join_path_components(backup_label,pgdata, "backup_label");
if (fio_access(backup_label, F_OK, FIO_DB_HOST) == 0)
{
elog(WARNING, "Destination directory contains \"backup_control\" file. "
Expand Down
4 changes: 2 additions & 2 deletionssrc/util.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -418,7 +418,7 @@ set_min_recovery_point(pgFile *file, const char *backup_path,
FIN_CRC32C(ControlFile.crc);

/* overwrite pg_control */
snprintf(fullpath, sizeof(fullpath), "%s/%s", backup_path, XLOG_CONTROL_FILE);
join_path_components(fullpath, backup_path, XLOG_CONTROL_FILE);
writeControlFile(&ControlFile, fullpath, FIO_LOCAL_HOST);

/* Update pg_control checksum in backup_list */
Expand DownExpand Up@@ -569,7 +569,7 @@ check_postmaster(const char *pgdata)
pid_t pid;
char pid_file[MAXPGPATH];

snprintf(pid_file,MAXPGPATH, "%s/postmaster.pid", pgdata);
join_path_components(pid_file,pgdata, "postmaster.pid");

fp = fopen(pid_file, "r");
if (fp == NULL)
Expand Down
2 changes: 1 addition & 1 deletionsrc/utils/pgut.c
View file
Open in desktop
Original file line numberDiff line numberDiff line change
Expand Up@@ -1184,7 +1184,7 @@ pgut_rmtree(const char *path, bool rmtopdir, bool strict)
/* now we have the names we can start removing things */
for (filename = filenames; *filename; filename++)
{
snprintf(pathbuf, MAXPGPATH, "%s/%s", path, *filename);
join_path_components(pathbuf, path, *filename);

if (lstat(pathbuf, &statbuf) != 0)
{
Expand Down

[8]ページ先頭

©2009-2025 Movatter.jp