aboutsummaryrefslogtreecommitdiff
path: root/src/backend/replication/basebackup.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/backend/replication/basebackup.c')
-rw-r--r--src/backend/replication/basebackup.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/src/backend/replication/basebackup.c b/src/backend/replication/basebackup.c
index ebb8fde3bc4..b264b69aef6 100644
--- a/src/backend/replication/basebackup.c
+++ b/src/backend/replication/basebackup.c
@@ -367,9 +367,6 @@ perform_base_backup(basebackup_options *opt, DIR *tblspcdir)
XLogFileName(lastoff, ThisTimeLineID, endsegno, wal_segment_size);
dir = AllocateDir("pg_wal");
- if (!dir)
- ereport(ERROR,
- (errmsg("could not open directory \"%s\": %m", "pg_wal")));
while ((de = ReadDir(dir, "pg_wal")) != NULL)
{
/* Does it look like a WAL segment, and is it in the range? */
@@ -713,7 +710,9 @@ SendBaseBackup(BaseBackupCmd *cmd)
dir = AllocateDir("pg_tblspc");
if (!dir)
ereport(ERROR,
- (errmsg("could not open directory \"%s\": %m", "pg_tblspc")));
+ (errcode_for_file_access(),
+ errmsg("could not open directory \"%s\": %m",
+ "pg_tblspc")));
perform_base_backup(&opt, dir);