diff options
| author | Bruce Momjian | 2003-05-15 16:35:30 +0000 |
|---|---|---|
| committer | Bruce Momjian | 2003-05-15 16:35:30 +0000 |
| commit | 12c942383296bd626131241c012c2ab81b081738 (patch) | |
| tree | 7a37bb6990282b36be53fae1bde399d8e603e9f9 /src/backend/utils/init | |
| parent | 2c0556068fc308ed9cce06c85de7e42305d34b86 (diff) | |
Allow Win32 to compile under MinGW. Major changes are:
Win32 port is now called 'win32' rather than 'win'
add -lwsock32 on Win32
make gethostname() be only used when kerberos4 is enabled
use /port/getopt.c
new /port/opendir.c routines
disable GUC unix_socket_group on Win32
convert some keywords.c symbols to KEYWORD_P to prevent conflict
create new FCNTL_NONBLOCK macro to turn off socket blocking
create new /include/port.h file that has /port prototypes, move
out of c.h
new /include/port/win32_include dir to hold missing include files
work around ERROR being defined in Win32 includes
Diffstat (limited to 'src/backend/utils/init')
| -rw-r--r-- | src/backend/utils/init/findbe.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/src/backend/utils/init/findbe.c b/src/backend/utils/init/findbe.c index 94d744bce9c..b0bb7923795 100644 --- a/src/backend/utils/init/findbe.c +++ b/src/backend/utils/init/findbe.c @@ -7,7 +7,7 @@ * * * IDENTIFICATION - * $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.32 2003/04/04 20:42:12 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.33 2003/05/15 16:35:29 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -44,9 +44,11 @@ static int ValidateBinary(char *path) { struct stat buf; +#ifndef WIN32 uid_t euid; struct group *gp; struct passwd *pwp; +#endif int i; int is_r = 0; int is_x = 0; @@ -82,6 +84,11 @@ ValidateBinary(char *path) * Ensure that the file is both executable and readable (required for * dynamic loading). */ +#ifdef WIN32 + is_r = buf.st_mode & S_IRUSR; + is_x = buf.st_mode & S_IXUSR; + return is_x ? (is_r ? 0 : -2) : -1; +#else euid = geteuid(); if (euid == buf.st_uid) { @@ -125,6 +132,7 @@ ValidateBinary(char *path) elog(DEBUG2, "ValidateBinary: \"%s\" is not other read/execute", path); return is_x ? (is_r ? 0 : -2) : -1; +#endif } /* |
