]> granicus.if.org Git - postgresql/commitdiff
Add .exe to Win32 stat calls. Don't symlink postmaster on Win32.
authorBruce Momjian <bruce@momjian.us>
Tue, 11 Nov 2003 03:53:33 +0000 (03:53 +0000)
committerBruce Momjian <bruce@momjian.us>
Tue, 11 Nov 2003 03:53:33 +0000 (03:53 +0000)
src/backend/Makefile
src/backend/utils/init/findbe.c

index 82cdd0f568ee051d621a825e8dd43cea331c5df1..4b807ed6de00480a7c3eec9f25117b896264a401 100644 (file)
@@ -4,7 +4,7 @@
 #
 # Copyright (c) 1994, Regents of the University of California
 #
-# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.95 2003/03/21 17:18:34 petere Exp $
+# $Header: /cvsroot/pgsql/src/backend/Makefile,v 1.96 2003/11/11 03:53:32 momjian Exp $
 #
 #-------------------------------------------------------------------------
 
@@ -138,8 +138,12 @@ endif
 
 install-bin: postgres $(POSTGRES_IMP) installdirs
        $(INSTALL_PROGRAM) postgres$(X) $(DESTDIR)$(bindir)/postgres$(X)
-       @rm -f $(DESTDIR)$(bindir)/postmaster
-       ln -s postgres$(X) $(DESTDIR)$(bindir)/postmaster
+ifneq ($(PORTNAME), win32)
+       @rm -f $(DESTDIR)$(bindir)/postmaster$(X)
+       ln -s postgres$(X) $(DESTDIR)$(bindir)/postmaster$(X)
+else
+       $(INSTALL_PROGRAM) postgres$(X) $(DESTDIR)$(bindir)/postmaster$(X)
+endif
 ifeq ($(MAKE_EXPORTS), true)
        $(INSTALL_DATA) $(POSTGRES_IMP) $(DESTDIR)$(pkglibdir)/$(POSTGRES_IMP)
 endif
index f08d2991a80661e05717c07fafaa079d54fc04bc..1839b7a2648c26b720c94aafa15f094ec500662a 100644 (file)
@@ -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.
         *