summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/backend/postmaster/pgstat.c10
-rw-r--r--src/backend/utils/init/globals.c3
-rw-r--r--src/bin/initdb/initdb.c4
-rw-r--r--src/include/miscadmin.h3
-rw-r--r--src/port/exec.c4
-rw-r--r--src/port/path.c4
-rw-r--r--src/timezone/pgtz.c7
7 files changed, 19 insertions, 16 deletions
diff --git a/src/backend/postmaster/pgstat.c b/src/backend/postmaster/pgstat.c
index 1c76fd97708..c102cdd7aa2 100644
--- a/src/backend/postmaster/pgstat.c
+++ b/src/backend/postmaster/pgstat.c
@@ -13,7 +13,7 @@
*
* Copyright (c) 2001-2003, PostgreSQL Global Development Group
*
- * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.69 2004/05/13 22:45:02 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.70 2004/05/18 03:36:30 momjian Exp $
* ----------
*/
#include "postgres.h"
@@ -487,7 +487,7 @@ pgstat_forkexec(STATS_PROCESS_TYPE procType)
/* + the pstat file names, and postgres pathname */
snprintf(pgstatBuf[bufc++],MAXPGPATH,"\"%s\"",pgStat_tmpfname);
snprintf(pgstatBuf[bufc++],MAXPGPATH,"\"%s\"",pgStat_fname);
- snprintf(pgstatBuf[bufc++],MAXPGPATH,"\"%s\"",my_exec_path); /* used? */
+ snprintf(pgstatBuf[bufc++],MAXPGPATH,"\"%s\"",postgres_exec_path);
snprintf(pgstatBuf[bufc++],MAXPGPATH,"\"%s\"",DataDir);
/* Add to the arg list */
@@ -500,9 +500,9 @@ pgstat_forkexec(STATS_PROCESS_TYPE procType)
/* Fire off execv in child */
#ifdef WIN32
- pid = win32_forkexec(my_exec_path, av);
+ pid = win32_forkexec(postgres_exec_path, av);
#else
- if ((pid = fork()) == 0 && (execv(my_exec_path, av) == -1))
+ if ((pid = fork()) == 0 && (execv(postgres_exec_path, av) == -1))
/* FIXME: [fork/exec] suggestions for what to do here? Can't call elog... */
abort();
#endif
@@ -532,7 +532,7 @@ pgstat_parseArgs(PGSTAT_FORK_ARGS)
MaxBackends = atoi(argv[argc++]);
StrNCpy(pgStat_tmpfname,argv[argc++],MAXPGPATH);
StrNCpy(pgStat_fname, argv[argc++],MAXPGPATH);
- StrNCpy(my_exec_path, argv[argc++],MAXPGPATH);
+ StrNCpy(postgres_exec_path, argv[argc++],MAXPGPATH);
DataDir = strdup(argv[argc++]);
read_nondefault_variables();
diff --git a/src/backend/utils/init/globals.c b/src/backend/utils/init/globals.c
index d94130a1b0a..a3d13b9cedc 100644
--- a/src/backend/utils/init/globals.c
+++ b/src/backend/utils/init/globals.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/backend/utils/init/globals.c,v 1.86 2004/05/17 14:35:32 momjian Exp $
+ * $PostgreSQL: pgsql/src/backend/utils/init/globals.c,v 1.87 2004/05/18 03:36:36 momjian Exp $
*
* NOTES
* Globals used all over the place should be declared here and not
@@ -46,6 +46,7 @@ char *DataDir = NULL;
char OutputFileName[MAXPGPATH];
char my_exec_path[MAXPGPATH]; /* full path to postgres executable */
+char postgres_exec_path[MAXPGPATH]; /* full path to backend executable */
char pkglib_path[MAXPGPATH]; /* full path to lib directory */
BackendId MyBackendId;
diff --git a/src/bin/initdb/initdb.c b/src/bin/initdb/initdb.c
index 5aae743f0f5..85d65ab459c 100644
--- a/src/bin/initdb/initdb.c
+++ b/src/bin/initdb/initdb.c
@@ -39,7 +39,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
* Portions taken from FreeBSD.
*
- * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.31 2004/05/17 14:35:33 momjian Exp $
+ * $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.32 2004/05/18 03:36:36 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1957,6 +1957,8 @@ main(int argc, char *argv[])
get_share_path(backend_exec, share_path);
}
+ canonicalize_path(share_path);
+
if ((short_version = get_short_version()) == NULL)
{
fprintf(stderr, _("%s: could not determine valid short version string\n"), progname);
diff --git a/src/include/miscadmin.h b/src/include/miscadmin.h
index a97caf0fac2..03491f2ee56 100644
--- a/src/include/miscadmin.h
+++ b/src/include/miscadmin.h
@@ -13,7 +13,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.159 2004/05/17 14:35:33 momjian Exp $
+ * $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.160 2004/05/18 03:36:44 momjian Exp $
*
* NOTES
* some of the information in this file should be moved to
@@ -143,6 +143,7 @@ extern long MyCancelKey;
extern char OutputFileName[];
extern char my_exec_path[];
+extern char postgres_exec_path[];
extern char pkglib_path[];
/*
diff --git a/src/port/exec.c b/src/port/exec.c
index 02defe9a8dd..f98acda3984 100644
--- a/src/port/exec.c
+++ b/src/port/exec.c
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/exec.c,v 1.6 2004/05/17 14:35:34 momjian Exp $
+ * $PostgreSQL: pgsql/src/port/exec.c,v 1.7 2004/05/18 03:36:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -345,7 +345,7 @@ win32_make_absolute(char *path)
if (_fullpath(abspath, path, MAXPGPATH) == NULL)
{
log_debug("Win32 path expansion failed: %s", strerror(errno));
- return path;
+ StrNCpy(abspath, path, MAXPGPATH);
}
canonicalize_path(abspath);
diff --git a/src/port/path.c b/src/port/path.c
index f5fccca2787..565f496173a 100644
--- a/src/port/path.c
+++ b/src/port/path.c
@@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/port/path.c,v 1.8 2004/05/17 14:35:34 momjian Exp $
+ * $PostgreSQL: pgsql/src/port/path.c,v 1.9 2004/05/18 03:36:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -234,7 +234,7 @@ relative_path(const char *path1, const char *path2)
(!isalpha(*path2) || !path2[1] == ':'))
return false;
if ((!isalpha(*path1) || !path1[1] == ':') &&
- (isalpha(*path2) && path2[1] == ':')
+ (isalpha(*path2) && path2[1] == ':'))
return false;
if (isalpha(*path1) && path1[1] == ':' &&
isalpha(*path2) && path2[1] == ':')
diff --git a/src/timezone/pgtz.c b/src/timezone/pgtz.c
index 3cb3849434d..c51e3b0382b 100644
--- a/src/timezone/pgtz.c
+++ b/src/timezone/pgtz.c
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
*
* IDENTIFICATION
- * $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.8 2004/05/17 14:35:34 momjian Exp $
+ * $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.9 2004/05/18 03:36:45 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -17,15 +17,14 @@
static char tzdir[MAXPGPATH];
static int done_tzdir = 0;
+
char *
pg_TZDIR(void)
{
- char *p;
-
if (done_tzdir)
return tzdir;
- get_share_dir(my_exec_path, tzdir);
+ get_share_path(my_exec_path, tzdir);
strcat(tzdir, "/timezone");
done_tzdir = 1;