summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--contrib/dbsize/dbsize.c4
-rw-r--r--src/port/exec.c10
2 files changed, 7 insertions, 7 deletions
diff --git a/contrib/dbsize/dbsize.c b/contrib/dbsize/dbsize.c
index f6ed57d4638..85d09e59c81 100644
--- a/contrib/dbsize/dbsize.c
+++ b/contrib/dbsize/dbsize.c
@@ -5,7 +5,7 @@
* Copyright (c) 2002-2005, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/contrib/dbsize/dbsize.c,v 1.16 2005/01/01 05:43:05 momjian Exp $
+ * $PostgreSQL: pgsql/contrib/dbsize/dbsize.c,v 1.16.4.1 2008/03/31 01:33:13 tgl Exp $
*
*/
@@ -169,7 +169,7 @@ pg_tablespace_size(PG_FUNCTION_ARGS)
errmsg("could not stat \"%s\": %m", pathname)));
totalsize += fst.st_size;
- if (fst.st_mode & S_IFDIR)
+ if (S_ISDIR(fst.st_mode))
totalsize += db_dir_size(pathname);
}
diff --git a/src/port/exec.c b/src/port/exec.c
index 355be22574e..0c99ced2780 100644
--- a/src/port/exec.c
+++ b/src/port/exec.c
@@ -9,7 +9,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/exec.c,v 1.37 2005/01/14 17:47:49 tgl Exp $
+ * $PostgreSQL: pgsql/src/port/exec.c,v 1.37.4.1 2008/03/31 01:33:13 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -79,8 +79,8 @@ validate_exec(const char *path)
#else
char path_exe[MAXPGPATH + sizeof(".exe") - 1];
#endif
- int is_r = 0;
- int is_x = 0;
+ int is_r;
+ int is_x;
#ifdef WIN32
/* Win32 requires a .exe suffix for stat() */
@@ -102,7 +102,7 @@ validate_exec(const char *path)
if (stat(path, &buf) < 0)
return -1;
- if ((buf.st_mode & S_IFMT) != S_IFREG)
+ if (!S_ISREG(buf.st_mode))
return -1;
/*
@@ -330,7 +330,7 @@ resolve_symlinks(char *path)
fname = path;
if (lstat(fname, &buf) < 0 ||
- (buf.st_mode & S_IFMT) != S_IFLNK)
+ !S_ISLNK(buf.st_mode))
break;
rllen = readlink(fname, link_buf, sizeof(link_buf));