summaryrefslogtreecommitdiff
path: root/contrib/pg_upgrade/file.c
diff options
context:
space:
mode:
Diffstat (limited to 'contrib/pg_upgrade/file.c')
-rw-r--r--contrib/pg_upgrade/file.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/contrib/pg_upgrade/file.c b/contrib/pg_upgrade/file.c
index 1b25a212c0b..e84110665fe 100644
--- a/contrib/pg_upgrade/file.c
+++ b/contrib/pg_upgrade/file.c
@@ -440,13 +440,13 @@ copy_dir(const char *src, const char *dst, bool force)
return -1;
}
- if (fst.st_mode & S_IFDIR)
+ if (S_ISDIR(fst.st_mode))
{
/* recurse to handle subdirectories */
if (force)
copy_dir(src_file, dest_file, true);
}
- else if (fst.st_mode & S_IFREG)
+ else if (S_ISREG(fst.st_mode))
{
if ((copy_file(src_file, dest_file, 1)) == -1)
{