mirror of
https://github.com/postgres/postgres.git
synced 2025-11-12 05:01:15 +03:00
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
This commit is contained in:
@@ -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
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
Reference in New Issue
Block a user