Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
P
Postgres FD Implementation
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Abuhujair Javed
Postgres FD Implementation
Commits
3255851e
Commit
3255851e
authored
May 20, 2004
by
Bruce Momjian
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Small variable rename in exec.c.
parent
ceceeffe
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
19 additions
and
19 deletions
+19
-19
src/include/port.h
src/include/port.h
+2
-2
src/port/exec.c
src/port/exec.c
+17
-17
No files found.
src/include/port.h
View file @
3255851e
...
...
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/port.h,v 1.3
4 2004/05/20 01:47:0
1 momjian Exp $
* $PostgreSQL: pgsql/src/include/port.h,v 1.3
5 2004/05/20 15:38:1
1 momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -59,7 +59,7 @@ extern void get_pkglib_path(const char *my_exec_path, char *ret_path);
/* 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
*
ret
path
);
extern
int
find_other_exec
(
const
char
*
argv0
,
char
const
*
target
,
const
char
*
versionstr
,
char
*
retpath
);
#if defined(__CYGWIN__) || defined(WIN32)
...
...
src/port/exec.c
View file @
3255851e
...
...
@@ -7,7 +7,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/port/exec.c,v 1.1
1 2004/05/20 15:35:4
1 momjian Exp $
* $PostgreSQL: pgsql/src/port/exec.c,v 1.1
2 2004/05/20 15:38:1
1 momjian Exp $
*
*-------------------------------------------------------------------------
*/
...
...
@@ -179,7 +179,7 @@ validate_exec(char *path)
* non-threaded binaries, not in library routines.
*/
int
find_my_exec
(
const
char
*
argv0
,
char
*
full_
path
)
find_my_exec
(
const
char
*
argv0
,
char
*
ret
path
)
{
char
cwd
[
MAXPGPATH
];
char
*
p
;
...
...
@@ -210,19 +210,19 @@ find_my_exec(const char *argv0, char *full_path)
}
if
(
is_absolute_path
(
argv0
))
StrNCpy
(
full_
path
,
argv0
,
MAXPGPATH
);
StrNCpy
(
ret
path
,
argv0
,
MAXPGPATH
);
else
snprintf
(
full_
path
,
MAXPGPATH
,
"%s/%s"
,
cwd
,
argv0
);
snprintf
(
ret
path
,
MAXPGPATH
,
"%s/%s"
,
cwd
,
argv0
);
canonicalize_path
(
full_
path
);
if
(
validate_exec
(
full_
path
)
==
0
)
canonicalize_path
(
ret
path
);
if
(
validate_exec
(
ret
path
)
==
0
)
{
win32_make_absolute
(
full_
path
);
win32_make_absolute
(
ret
path
);
return
0
;
}
else
{
log_error
(
"invalid binary
\"
%s
\"
"
,
full_
path
);
log_error
(
"invalid binary
\"
%s
\"
"
,
ret
path
);
return
-
1
;
}
}
...
...
@@ -231,8 +231,8 @@ find_my_exec(const char *argv0, char *full_path)
/* Win32 checks the current directory first for names without slashes */
if
(
validate_exec
(
argv0
)
==
0
)
{
snprintf
(
full_
path
,
MAXPGPATH
,
"%s/%s"
,
cwd
,
argv0
);
win32_make_absolute
(
full_
path
);
snprintf
(
ret
path
,
MAXPGPATH
,
"%s/%s"
,
cwd
,
argv0
);
win32_make_absolute
(
ret
path
);
return
0
;
}
#endif
...
...
@@ -254,21 +254,21 @@ find_my_exec(const char *argv0, char *full_path)
*
endp
=
'\0'
;
if
(
is_absolute_path
(
startp
))
snprintf
(
full_
path
,
MAXPGPATH
,
"%s/%s"
,
startp
,
argv0
);
snprintf
(
ret
path
,
MAXPGPATH
,
"%s/%s"
,
startp
,
argv0
);
else
snprintf
(
full_
path
,
MAXPGPATH
,
"%s/%s/%s"
,
cwd
,
startp
,
argv0
);
snprintf
(
ret
path
,
MAXPGPATH
,
"%s/%s/%s"
,
cwd
,
startp
,
argv0
);
canonicalize_path
(
full_
path
);
switch
(
validate_exec
(
full_
path
))
canonicalize_path
(
ret
path
);
switch
(
validate_exec
(
ret
path
))
{
case
0
:
/* found ok */
win32_make_absolute
(
full_
path
);
win32_make_absolute
(
ret
path
);
free
(
path
);
return
0
;
case
-
1
:
/* wasn't even a candidate, keep looking */
break
;
case
-
2
:
/* found but disqualified */
log_error
(
"could not read binary
\"
%s
\"
"
,
full_
path
);
log_error
(
"could not read binary
\"
%s
\"
"
,
ret
path
);
free
(
path
);
return
-
1
;
}
...
...
@@ -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
* method works too.
*/
if (GetModuleFileName(NULL,
full_path,
MAXPGPATH) == 0)
if (GetModuleFileName(NULL,
retpath,
MAXPGPATH) == 0)
log_error("GetModuleFileName failed (%i)",(int)GetLastError());
#endif
}
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment