7
7
*
8
8
*
9
9
* 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 $
11
11
*
12
12
*-------------------------------------------------------------------------
13
13
*/
@@ -179,7 +179,7 @@ validate_exec(char *path)
179
179
* non-threaded binaries, not in library routines.
180
180
*/
181
181
int
182
- find_my_exec (const char * argv0 , char * full_path )
182
+ find_my_exec (const char * argv0 , char * retpath )
183
183
{
184
184
char cwd [MAXPGPATH ];
185
185
char * p ;
@@ -210,19 +210,19 @@ find_my_exec(const char *argv0, char *full_path)
210
210
}
211
211
212
212
if (is_absolute_path (argv0 ))
213
- StrNCpy (full_path , argv0 , MAXPGPATH );
213
+ StrNCpy (retpath , argv0 , MAXPGPATH );
214
214
else
215
- snprintf (full_path , MAXPGPATH , "%s/%s" , cwd , argv0 );
215
+ snprintf (retpath , MAXPGPATH , "%s/%s" , cwd , argv0 );
216
216
217
- canonicalize_path (full_path );
218
- if (validate_exec (full_path ) == 0 )
217
+ canonicalize_path (retpath );
218
+ if (validate_exec (retpath ) == 0 )
219
219
{
220
- win32_make_absolute (full_path );
220
+ win32_make_absolute (retpath );
221
221
return 0 ;
222
222
}
223
223
else
224
224
{
225
- log_error ("invalid binary \"%s\"" , full_path );
225
+ log_error ("invalid binary \"%s\"" , retpath );
226
226
return -1 ;
227
227
}
228
228
}
@@ -231,8 +231,8 @@ find_my_exec(const char *argv0, char *full_path)
231
231
/* Win32 checks the current directory first for names without slashes */
232
232
if (validate_exec (argv0 ) == 0 )
233
233
{
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 );
236
236
return 0 ;
237
237
}
238
238
#endif
@@ -254,21 +254,21 @@ find_my_exec(const char *argv0, char *full_path)
254
254
* endp = '\0' ;
255
255
256
256
if (is_absolute_path (startp ))
257
- snprintf (full_path , MAXPGPATH , "%s/%s" , startp , argv0 );
257
+ snprintf (retpath , MAXPGPATH , "%s/%s" , startp , argv0 );
258
258
else
259
- snprintf (full_path , MAXPGPATH , "%s/%s/%s" , cwd , startp , argv0 );
259
+ snprintf (retpath , MAXPGPATH , "%s/%s/%s" , cwd , startp , argv0 );
260
260
261
- canonicalize_path (full_path );
262
- switch (validate_exec (full_path ))
261
+ canonicalize_path (retpath );
262
+ switch (validate_exec (retpath ))
263
263
{
264
264
case 0 : /* found ok */
265
- win32_make_absolute (full_path );
265
+ win32_make_absolute (retpath );
266
266
free (path );
267
267
return 0 ;
268
268
case -1 : /* wasn't even a candidate, keep looking */
269
269
break ;
270
270
case -2 : /* found but disqualified */
271
- log_error ("could not read binary \"%s\"" , full_path );
271
+ log_error ("could not read binary \"%s\"" , retpath );
272
272
free (path );
273
273
return -1 ;
274
274
}
@@ -286,7 +286,7 @@ find_my_exec(const char *argv0, char *full_path)
286
286
* Win32 has a native way to find the executable name, but the above
287
287
* method works too.
288
288
*/
289
- if (GetModuleFileName (NULL ,full_path , MAXPGPATH ) == 0 )
289
+ if (GetModuleFileName (NULL , retpath , MAXPGPATH ) == 0 )
290
290
log_error ("GetModuleFileName failed (%i)" ,(int )GetLastError ());
291
291
#endif
292
292
}
0 commit comments