Commit 3255851e authored by Bruce Momjian's avatar Bruce Momjian

Small variable rename in exec.c.

parent ceceeffe
...@@ -6,7 +6,7 @@ ...@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group * Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California * Portions Copyright (c) 1994, Regents of the University of California
* *
* $PostgreSQL: pgsql/src/include/port.h,v 1.34 2004/05/20 01:47:01 momjian Exp $ * $PostgreSQL: pgsql/src/include/port.h,v 1.35 2004/05/20 15:38:11 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -59,7 +59,7 @@ extern void get_pkglib_path(const char *my_exec_path, char *ret_path); ...@@ -59,7 +59,7 @@ extern void get_pkglib_path(const char *my_exec_path, char *ret_path);
/* Portable way to find binaries */ /* Portable way to find binaries */
extern int find_my_exec(const char *argv0, char *full_path); extern int find_my_exec(const char *argv0, char *retpath);
extern int find_other_exec(const char *argv0, char const *target, extern int find_other_exec(const char *argv0, char const *target,
const char *versionstr, char *retpath); const char *versionstr, char *retpath);
#if defined(__CYGWIN__) || defined(WIN32) #if defined(__CYGWIN__) || defined(WIN32)
......
...@@ -7,7 +7,7 @@ ...@@ -7,7 +7,7 @@
* *
* *
* IDENTIFICATION * IDENTIFICATION
* $PostgreSQL: pgsql/src/port/exec.c,v 1.11 2004/05/20 15:35:41 momjian Exp $ * $PostgreSQL: pgsql/src/port/exec.c,v 1.12 2004/05/20 15:38:11 momjian Exp $
* *
*------------------------------------------------------------------------- *-------------------------------------------------------------------------
*/ */
...@@ -179,7 +179,7 @@ validate_exec(char *path) ...@@ -179,7 +179,7 @@ validate_exec(char *path)
* non-threaded binaries, not in library routines. * non-threaded binaries, not in library routines.
*/ */
int int
find_my_exec(const char *argv0, char *full_path) find_my_exec(const char *argv0, char *retpath)
{ {
char cwd[MAXPGPATH]; char cwd[MAXPGPATH];
char *p; char *p;
...@@ -210,19 +210,19 @@ find_my_exec(const char *argv0, char *full_path) ...@@ -210,19 +210,19 @@ find_my_exec(const char *argv0, char *full_path)
} }
if (is_absolute_path(argv0)) if (is_absolute_path(argv0))
StrNCpy(full_path, argv0, MAXPGPATH); StrNCpy(retpath, argv0, MAXPGPATH);
else else
snprintf(full_path, MAXPGPATH, "%s/%s", cwd, argv0); snprintf(retpath, MAXPGPATH, "%s/%s", cwd, argv0);
canonicalize_path(full_path); canonicalize_path(retpath);
if (validate_exec(full_path) == 0) if (validate_exec(retpath) == 0)
{ {
win32_make_absolute(full_path); win32_make_absolute(retpath);
return 0; return 0;
} }
else else
{ {
log_error("invalid binary \"%s\"", full_path); log_error("invalid binary \"%s\"", retpath);
return -1; return -1;
} }
} }
...@@ -231,8 +231,8 @@ find_my_exec(const char *argv0, char *full_path) ...@@ -231,8 +231,8 @@ find_my_exec(const char *argv0, char *full_path)
/* Win32 checks the current directory first for names without slashes */ /* Win32 checks the current directory first for names without slashes */
if (validate_exec(argv0) == 0) if (validate_exec(argv0) == 0)
{ {
snprintf(full_path, MAXPGPATH, "%s/%s", cwd, argv0); snprintf(retpath, MAXPGPATH, "%s/%s", cwd, argv0);
win32_make_absolute(full_path); win32_make_absolute(retpath);
return 0; return 0;
} }
#endif #endif
...@@ -254,21 +254,21 @@ find_my_exec(const char *argv0, char *full_path) ...@@ -254,21 +254,21 @@ find_my_exec(const char *argv0, char *full_path)
*endp = '\0'; *endp = '\0';
if (is_absolute_path(startp)) if (is_absolute_path(startp))
snprintf(full_path, MAXPGPATH, "%s/%s", startp, argv0); snprintf(retpath, MAXPGPATH, "%s/%s", startp, argv0);
else else
snprintf(full_path, MAXPGPATH, "%s/%s/%s", cwd, startp, argv0); snprintf(retpath, MAXPGPATH, "%s/%s/%s", cwd, startp, argv0);
canonicalize_path(full_path); canonicalize_path(retpath);
switch (validate_exec(full_path)) switch (validate_exec(retpath))
{ {
case 0: /* found ok */ case 0: /* found ok */
win32_make_absolute(full_path); win32_make_absolute(retpath);
free(path); free(path);
return 0; return 0;
case -1: /* wasn't even a candidate, keep looking */ case -1: /* wasn't even a candidate, keep looking */
break; break;
case -2: /* found but disqualified */ case -2: /* found but disqualified */
log_error("could not read binary \"%s\"", full_path); log_error("could not read binary \"%s\"", retpath);
free(path); free(path);
return -1; return -1;
} }
...@@ -286,7 +286,7 @@ find_my_exec(const char *argv0, char *full_path) ...@@ -286,7 +286,7 @@ find_my_exec(const char *argv0, char *full_path)
* Win32 has a native way to find the executable name, but the above * Win32 has a native way to find the executable name, but the above
* method works too. * method works too.
*/ */
if (GetModuleFileName(NULL,full_path,MAXPGPATH) == 0) if (GetModuleFileName(NULL, retpath, MAXPGPATH) == 0)
log_error("GetModuleFileName failed (%i)",(int)GetLastError()); log_error("GetModuleFileName failed (%i)",(int)GetLastError());
#endif #endif
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment