Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 3b382d1

Browse files
committed
Clean up some relative path install issues with Claudio's help.
1 parent 4307ca2 commit 3b382d1

File tree

7 files changed

+19
-16
lines changed

7 files changed

+19
-16
lines changed

src/backend/postmaster/pgstat.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
*
1414
* Copyright (c) 2001-2003, PostgreSQL Global Development Group
1515
*
16-
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.69 2004/05/13 22:45:02 momjian Exp $
16+
* $PostgreSQL: pgsql/src/backend/postmaster/pgstat.c,v 1.70 2004/05/18 03:36:30 momjian Exp $
1717
* ----------
1818
*/
1919
#include "postgres.h"
@@ -487,7 +487,7 @@ pgstat_forkexec(STATS_PROCESS_TYPE procType)
487487
/* + the pstat file names, and postgres pathname */
488488
snprintf(pgstatBuf[bufc++],MAXPGPATH,"\"%s\"",pgStat_tmpfname);
489489
snprintf(pgstatBuf[bufc++],MAXPGPATH,"\"%s\"",pgStat_fname);
490-
snprintf(pgstatBuf[bufc++],MAXPGPATH,"\"%s\"",my_exec_path); /* used? */
490+
snprintf(pgstatBuf[bufc++],MAXPGPATH,"\"%s\"",postgres_exec_path);
491491
snprintf(pgstatBuf[bufc++],MAXPGPATH,"\"%s\"",DataDir);
492492

493493
/* Add to the arg list */
@@ -500,9 +500,9 @@ pgstat_forkexec(STATS_PROCESS_TYPE procType)
500500

501501
/* Fire off execv in child */
502502
#ifdef WIN32
503-
pid = win32_forkexec(my_exec_path, av);
503+
pid = win32_forkexec(postgres_exec_path, av);
504504
#else
505-
if ((pid = fork()) == 0 && (execv(my_exec_path, av) == -1))
505+
if ((pid = fork()) == 0 && (execv(postgres_exec_path, av) == -1))
506506
/* FIXME: [fork/exec] suggestions for what to do here? Can't call elog... */
507507
abort();
508508
#endif
@@ -532,7 +532,7 @@ pgstat_parseArgs(PGSTAT_FORK_ARGS)
532532
MaxBackends = atoi(argv[argc++]);
533533
StrNCpy(pgStat_tmpfname,argv[argc++],MAXPGPATH);
534534
StrNCpy(pgStat_fname, argv[argc++],MAXPGPATH);
535-
StrNCpy(my_exec_path, argv[argc++],MAXPGPATH);
535+
StrNCpy(postgres_exec_path, argv[argc++],MAXPGPATH);
536536
DataDir = strdup(argv[argc++]);
537537

538538
read_nondefault_variables();

src/backend/utils/init/globals.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/utils/init/globals.c,v 1.86 2004/05/17 14:35:32 momjian Exp $
11+
* $PostgreSQL: pgsql/src/backend/utils/init/globals.c,v 1.87 2004/05/18 03:36:36 momjian Exp $
1212
*
1313
* NOTES
1414
* Globals used all over the place should be declared here and not
@@ -46,6 +46,7 @@ char *DataDir = NULL;
4646
char OutputFileName[MAXPGPATH];
4747

4848
char my_exec_path[MAXPGPATH]; /* full path to postgres executable */
49+
char postgres_exec_path[MAXPGPATH]; /* full path to backend executable */
4950
char pkglib_path[MAXPGPATH]; /* full path to lib directory */
5051

5152
BackendId MyBackendId;

src/bin/initdb/initdb.c

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@
3939
* Portions Copyright (c) 1994, Regents of the University of California
4040
* Portions taken from FreeBSD.
4141
*
42-
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.31 2004/05/17 14:35:33 momjian Exp $
42+
* $PostgreSQL: pgsql/src/bin/initdb/initdb.c,v 1.32 2004/05/18 03:36:36 momjian Exp $
4343
*
4444
*-------------------------------------------------------------------------
4545
*/
@@ -1957,6 +1957,8 @@ main(int argc, char *argv[])
19571957
get_share_path(backend_exec, share_path);
19581958
}
19591959

1960+
canonicalize_path(share_path);
1961+
19601962
if ((short_version = get_short_version()) == NULL)
19611963
{
19621964
fprintf(stderr, _("%s: could not determine valid short version string\n"), progname);

src/include/miscadmin.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
1414
* Portions Copyright (c) 1994, Regents of the University of California
1515
*
16-
* $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.159 2004/05/17 14:35:33 momjian Exp $
16+
* $PostgreSQL: pgsql/src/include/miscadmin.h,v 1.160 2004/05/18 03:36:44 momjian Exp $
1717
*
1818
* NOTES
1919
* some of the information in this file should be moved to
@@ -143,6 +143,7 @@ extern long MyCancelKey;
143143

144144
extern char OutputFileName[];
145145
extern char my_exec_path[];
146+
extern char postgres_exec_path[];
146147
extern char pkglib_path[];
147148

148149
/*

src/port/exec.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
*
88
*
99
* IDENTIFICATION
10-
* $PostgreSQL: pgsql/src/port/exec.c,v 1.6 2004/05/17 14:35:34 momjian Exp $
10+
* $PostgreSQL: pgsql/src/port/exec.c,v 1.7 2004/05/18 03:36:45 momjian Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -345,7 +345,7 @@ win32_make_absolute(char *path)
345345
if (_fullpath(abspath, path, MAXPGPATH) == NULL)
346346
{
347347
log_debug("Win32 path expansion failed: %s", strerror(errno));
348-
return path;
348+
StrNCpy(abspath, path, MAXPGPATH);
349349
}
350350
canonicalize_path(abspath);
351351

src/port/path.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/port/path.c,v 1.8 2004/05/17 14:35:34 momjian Exp $
11+
* $PostgreSQL: pgsql/src/port/path.c,v 1.9 2004/05/18 03:36:45 momjian Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -234,7 +234,7 @@ relative_path(const char *path1, const char *path2)
234234
(!isalpha(*path2) || !path2[1] == ':'))
235235
return false;
236236
if ((!isalpha(*path1) || !path1[1] == ':') &&
237-
(isalpha(*path2) && path2[1] == ':')
237+
(isalpha(*path2) && path2[1] == ':'))
238238
return false;
239239
if (isalpha(*path1) && path1[1] == ':' &&
240240
isalpha(*path2) && path2[1] == ':')

src/timezone/pgtz.c

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
77
*
88
* IDENTIFICATION
9-
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.8 2004/05/17 14:35:34 momjian Exp $
9+
* $PostgreSQL: pgsql/src/timezone/pgtz.c,v 1.9 2004/05/18 03:36:45 momjian Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -17,15 +17,14 @@
1717

1818
static char tzdir[MAXPGPATH];
1919
static int done_tzdir = 0;
20+
2021
char *
2122
pg_TZDIR(void)
2223
{
23-
char *p;
24-
2524
if (done_tzdir)
2625
return tzdir;
2726

28-
get_share_dir(my_exec_path, tzdir);
27+
get_share_path(my_exec_path, tzdir);
2928
strcat(tzdir, "/timezone");
3029

3130
done_tzdir = 1;

0 commit comments

Comments
 (0)