diff options
author | Bruce Momjian | 2003-11-11 03:53:33 +0000 |
---|---|---|
committer | Bruce Momjian | 2003-11-11 03:53:33 +0000 |
commit | 0a2c82b5f73cc2d7f1a5963b6d320cbe57dd10d1 (patch) | |
tree | 78c2d1abed734b52b424ba9c98a48bda45a26cef /src/backend/utils/init/findbe.c | |
parent | 580fb7fb41414da359133a0342505dd3c9a7756a (diff) |
Add .exe to Win32 stat calls. Don't symlink postmaster on Win32.
Diffstat (limited to 'src/backend/utils/init/findbe.c')
-rw-r--r-- | src/backend/utils/init/findbe.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/src/backend/utils/init/findbe.c b/src/backend/utils/init/findbe.c index f08d2991a80..1839b7a2648 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.37 2003/08/04 02:40:06 momjian Exp $ + * $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.38 2003/11/11 03:53:33 momjian Exp $ * *------------------------------------------------------------------------- */ @@ -49,12 +49,23 @@ ValidateBinary(char *path) uid_t euid; struct group *gp; struct passwd *pwp; + char path_exe[MAXPGPATH + 2 + strlen(".exe")]; #endif int i; int is_r = 0; int is_x = 0; int in_grp = 0; +#ifdef WIN32 + /* Win32 requires a .exe suffix for stat() */ + if (strlen(path) >= 4 && strcmp(path + strlen(path) - strlen(".exe"), ".exe") != 0) + { + strcpy(path_exe, path); + strcat(path_exe, ".exe"); + path = path_exe; + } +#endif + /* * Ensure that the file exists and is a regular file. * |