77 *
88 *
99 * IDENTIFICATION
10- * $PostgreSQL: pgsql/src/port/exec.c,v 1.11 2004/05/20 15:35:41 momjian Exp $
10+ * $PostgreSQL: pgsql/src/port/exec.c,v 1.12 2004/05/20 15:38:11 momjian Exp $
1111 *
1212 *-------------------------------------------------------------------------
1313 */
@@ -179,7 +179,7 @@ validate_exec(char *path)
179179 * non-threaded binaries, not in library routines.
180180 */
181181int
182- find_my_exec (const char * argv0 , char * full_path )
182+ find_my_exec (const char * argv0 , char * retpath )
183183{
184184 char cwd [MAXPGPATH ];
185185 char * p ;
@@ -210,19 +210,19 @@ find_my_exec(const char *argv0, char *full_path)
210210 }
211211
212212 if (is_absolute_path (argv0 ))
213- StrNCpy (full_path , argv0 , MAXPGPATH );
213+ StrNCpy (retpath , argv0 , MAXPGPATH );
214214 else
215- snprintf (full_path , MAXPGPATH , "%s/%s" , cwd , argv0 );
215+ snprintf (retpath , MAXPGPATH , "%s/%s" , cwd , argv0 );
216216
217- canonicalize_path (full_path );
218- if (validate_exec (full_path ) == 0 )
217+ canonicalize_path (retpath );
218+ if (validate_exec (retpath ) == 0 )
219219 {
220- win32_make_absolute (full_path );
220+ win32_make_absolute (retpath );
221221 return 0 ;
222222 }
223223 else
224224 {
225- log_error ("invalid binary \"%s\"" , full_path );
225+ log_error ("invalid binary \"%s\"" , retpath );
226226 return -1 ;
227227 }
228228 }
@@ -231,8 +231,8 @@ find_my_exec(const char *argv0, char *full_path)
231231 /* Win32 checks the current directory first for names without slashes */
232232 if (validate_exec (argv0 ) == 0 )
233233 {
234- snprintf (full_path , MAXPGPATH , "%s/%s" , cwd , argv0 );
235- win32_make_absolute (full_path );
234+ snprintf (retpath , MAXPGPATH , "%s/%s" , cwd , argv0 );
235+ win32_make_absolute (retpath );
236236 return 0 ;
237237 }
238238#endif
@@ -254,21 +254,21 @@ find_my_exec(const char *argv0, char *full_path)
254254 * endp = '\0' ;
255255
256256 if (is_absolute_path (startp ))
257- snprintf (full_path , MAXPGPATH , "%s/%s" , startp , argv0 );
257+ snprintf (retpath , MAXPGPATH , "%s/%s" , startp , argv0 );
258258 else
259- snprintf (full_path , MAXPGPATH , "%s/%s/%s" , cwd , startp , argv0 );
259+ snprintf (retpath , MAXPGPATH , "%s/%s/%s" , cwd , startp , argv0 );
260260
261- canonicalize_path (full_path );
262- switch (validate_exec (full_path ))
261+ canonicalize_path (retpath );
262+ switch (validate_exec (retpath ))
263263 {
264264 case 0 : /* found ok */
265- win32_make_absolute (full_path );
265+ win32_make_absolute (retpath );
266266 free (path );
267267 return 0 ;
268268 case -1 : /* wasn't even a candidate, keep looking */
269269 break ;
270270 case -2 : /* found but disqualified */
271- log_error ("could not read binary \"%s\"" , full_path );
271+ log_error ("could not read binary \"%s\"" , retpath );
272272 free (path );
273273 return -1 ;
274274 }
@@ -286,7 +286,7 @@ find_my_exec(const char *argv0, char *full_path)
286286 * Win32 has a native way to find the executable name, but the above
287287 * method works too.
288288 */
289- if (GetModuleFileName (NULL ,full_path , MAXPGPATH ) == 0 )
289+ if (GetModuleFileName (NULL , retpath , MAXPGPATH ) == 0 )
290290 log_error ("GetModuleFileName failed (%i)" ,(int )GetLastError ());
291291#endif
292292}
0 commit comments