summaryrefslogtreecommitdiff
path: root/src/port/exec.c
diff options
context:
space:
mode:
authorBruce Momjian2004-05-17 14:35:34 +0000
committerBruce Momjian2004-05-17 14:35:34 +0000
commit3febb477e643c1cd37fc8d2d3e02685dce6d1196 (patch)
treeadc5f3696ec9001b0bda4d9c0336c50c251c2f62 /src/port/exec.c
parent85383214ea2b0085658a650b4e6b293464dcf045 (diff)
Reorganize code to allow path-relative installs.
Create new get_* functions to access compiled-in paths and adjust if relative installs are to be used. Clean up substitute_libpath_macro() code.
Diffstat (limited to 'src/port/exec.c')
-rw-r--r--src/port/exec.c19
1 files changed, 18 insertions, 1 deletions
diff --git a/src/port/exec.c b/src/port/exec.c
index 10220825519..02defe9a8dd 100644
--- a/src/port/exec.c
+++ b/src/port/exec.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/exec.c,v 1.5 2004/05/14 17:04:48 momjian Exp $
+ * $PostgreSQL: pgsql/src/port/exec.c,v 1.6 2004/05/17 14:35:34 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -25,6 +25,13 @@
#include "miscadmin.h"
+/* $PATH (or %PATH%) path separator */
+#ifdef WIN32
+#define PATHSEP ';'
+#else
+#define PATHSEP ':'
+#endif
+
#ifndef S_IRUSR /* XXX [TRH] should be in a header */
#define S_IRUSR S_IREAD
#define S_IWUSR S_IWRITE
@@ -265,6 +272,16 @@ find_my_exec(const char *argv0, char *full_path)
log_debug("could not find a \"%s\" to execute", argv0);
return -1;
+
+#if 0
+ /*
+ * Win32 has a native way to find the executable name, but the above
+ * method works too.
+ */
+ if (GetModuleFileName(NULL,basename,MAXPGPATH) == 0)
+ ereport(FATAL,
+ (errmsg("GetModuleFileName failed (%i)",(int)GetLastError())));
+#endif
}