Skip to content

Commit 0a2c82b

Browse files
committed
Add .exe to Win32 stat calls. Don't symlink postmaster on Win32.
1 parent 580fb7f commit 0a2c82b

File tree

2 files changed

+19
-4
lines changed

2 files changed

+19
-4
lines changed

src/backend/Makefile

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
#
55
# Copyright (c) 1994, Regents of the University of California
66
#
7-
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.95 2003/03/21 17:18:34 petere Exp $
7+
# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.96 2003/11/11 03:53:32 momjian Exp $
88
#
99
#-------------------------------------------------------------------------
1010

@@ -138,8 +138,12 @@ endif
138138

139139
install-bin: postgres $(POSTGRES_IMP) installdirs
140140
$(INSTALL_PROGRAM) postgres$(X) $(DESTDIR)$(bindir)/postgres$(X)
141-
@rm -f $(DESTDIR)$(bindir)/postmaster
142-
ln -s postgres$(X) $(DESTDIR)$(bindir)/postmaster
141+
ifneq ($(PORTNAME), win32)
142+
@rm -f $(DESTDIR)$(bindir)/postmaster$(X)
143+
ln -s postgres$(X) $(DESTDIR)$(bindir)/postmaster$(X)
144+
else
145+
$(INSTALL_PROGRAM) postgres$(X) $(DESTDIR)$(bindir)/postmaster$(X)
146+
endif
143147
ifeq ($(MAKE_EXPORTS), true)
144148
$(INSTALL_DATA) $(POSTGRES_IMP) $(DESTDIR)$(pkglibdir)/$(POSTGRES_IMP)
145149
endif

src/backend/utils/init/findbe.c

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.37 2003/08/04 02:40:06 momjian Exp $
10+
* $Header: /cvsroot/pgsql/src/backend/utils/init/Attic/findbe.c,v 1.38 2003/11/11 03:53:33 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -49,12 +49,23 @@ ValidateBinary(char *path)
4949
uid_t euid;
5050
struct group *gp;
5151
struct passwd *pwp;
52+
char path_exe[MAXPGPATH + 2 + strlen(".exe")];
5253
#endif
5354
int i;
5455
int is_r = 0;
5556
int is_x = 0;
5657
int in_grp = 0;
5758

59+
#ifdef WIN32
60+
/* Win32 requires a .exe suffix for stat() */
61+
if (strlen(path) >= 4 && strcmp(path + strlen(path) - strlen(".exe"), ".exe") != 0)
62+
{
63+
strcpy(path_exe, path);
64+
strcat(path_exe, ".exe");
65+
path = path_exe;
66+
}
67+
#endif
68+
5869
/*
5970
* Ensure that the file exists and is a regular file.
6071
*

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy