Skip to content

Commit dc50ba7

Browse files
committed
Move state() under backup_path initialization
1 parent 366073b commit dc50ba7

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

pg_probackup.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -110,7 +110,7 @@ main(int argc, char *argv[])
110110
char path[MAXPGPATH];
111111
/* Check if backup_path is directory. */
112112
struct stat stat_buf;
113-
int rc = stat(backup_path, &stat_buf);
113+
int rc;
114114

115115
/* initialize configuration */
116116
pgBackup_init(&current);
@@ -164,6 +164,7 @@ main(int argc, char *argv[])
164164
elog(ERROR, "required parameter not specified: BACKUP_PATH (-B, --backup-path)");
165165
}
166166

167+
rc = stat(backup_path, &stat_buf);
167168
/* If rc == -1, there is no file or directory. So it's OK. */
168169
if (rc != -1 && !S_ISDIR(stat_buf.st_mode))
169170
elog(ERROR, "-B, --backup-path must be a path to directory");

0 commit comments

Comments
 (0)