From 6e8274a0600fdd0b1b65f45a593a37cd3742d0e4 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Wed, 29 Apr 2020 12:09:07 -0400 Subject: [PATCH 2/2] Minor code cleanup for perform_base_backup(). Merge two calls to sendDir() that are exactly the same except for the fifth argument. Adjust comments to match. This seems a little bit clearer than the old way. --- src/backend/replication/basebackup.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c index b83c1edab0..150e382a40 100644 --- a/src/backend/replication/basebackup.c +++ b/src/backend/replication/basebackup.c @@ -421,25 +421,23 @@ perform_base_backup(basebackup_options *opt) if (ti->path == NULL) { struct stat statbuf; + bool sendtblspclinks = true; /* In the main tar, include the backup_label first... */ sendFileWithContent(BACKUP_LABEL_FILE, labelfile->data, &manifest); - /* - * Send tablespace_map file if required and then the bulk of - * the files. - */ + /* Then the tablespace_map file, if required... */ if (tblspc_map_file && opt->sendtblspcmapfile) { sendFileWithContent(TABLESPACE_MAP, tblspc_map_file->data, &manifest); - sendDir(".", 1, false, tablespaces, false, - &manifest, NULL); + sendtblspclinks = false; } - else - sendDir(".", 1, false, tablespaces, true, - &manifest, NULL); + + /* Then the bulk of the files... */ + sendDir(".", 1, false, tablespaces, sendtblspclinks, + &manifest, NULL); /* ... and pg_control after everything else. */ if (lstat(XLOG_CONTROL_FILE, &statbuf) != 0) -- 2.24.2 (Apple Git-127)